You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Derek Stevenson <de...@retrocode.com> on 2002/07/17 09:56:09 UTC

using my own Login action

Hi there,

I'm trying to extend the default LoginUser action in turbine, and I'm
performing the following steps:

- extending org.apache.turbine.modules.actions.LoginUser
- overriding doPerform and calling super.doPerform from within there to
still do Turbine's user authentication
- updating tr.props such that action.login = MyLoginUser
- updating Login.vm such that $link.setAction("MyLoginUser") will submit to
my login class

I've confirmed MyLoginUser executes, so I think I have the vm files and at
least the action.login property set correctly.  When I go to log in to the
site, however, users aren't authenticated properly and I can't gain access
to the site.

I suspected that somehow I was not doing everything I was supposed to in
simply extending LoginUser.  So, I copied and pasted the exact source for
org.apache.turbine.modules.actions.LoginUser into MyLoginUser.java and made
the appropriate changes for it to compile, thinking that by extending Action
directly I would fix it.  However, the same problem occurs - MyLoginUser
gets executed, but the users that previously were properly authenticated via
LoginUser are not logged in via MyLoginUser.  And this is where MyLoginUser
and LoginUser have IDENTICAL code save the classname and location in the
source tree.

Does anyone have any ideas or hints?  Am I missing a crucial step in the
sequence I initially outlined?  Does it matter where MyLoginUser resides
(it's currently in my application's modules/actions directory)?  I'm using
TDK 2.1 with turbine-2.1.jar and velocity-1.2-dev.jar.

Thanks,
Derek


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: using my own Login action

Posted by Derek Stevenson <de...@retrocode.com>.
Well, I seem to have figured it out.  In tr.props I was specifying

action.login = actions.MyLoginUser

since I thought I had to specify the login class relative to my package,
which I specified as

module.packages=edu.stanford.summit.mocha.modules

MyLoginUser was in the edu.stanford.summit.mocha.modules.actions package,
and while it *was* being executed it wasn't getting the proper RunData set
for doPerform().  So I changed the following in tr.props:

action.login = MyLoginUser

and voila, it works as expected now.  My conclusion here is turbine/velocity
assumes all actions are in the 'actions' subdirectory within the package
definition and the 'action.login' should be set to a package name relative
to the actions directory, not the modules package.

Based on some earlier messages, it sounds like turbine 3 will fix this all
up nice and spiffy-like, but for those still using tdk 2.1 hopefully this
will help some newbies (like me!) out there.

Cheers,
Derek

----- Original Message -----
From: "Derek Stevenson" <de...@retrocode.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Wednesday, July 17, 2002 12:56 AM
Subject: using my own Login action


> Hi there,
>
> I'm trying to extend the default LoginUser action in turbine, and I'm
> performing the following steps:
>
> - extending org.apache.turbine.modules.actions.LoginUser
> - overriding doPerform and calling super.doPerform from within there to
> still do Turbine's user authentication
> - updating tr.props such that action.login = MyLoginUser
> - updating Login.vm such that $link.setAction("MyLoginUser") will submit
to
> my login class
>
> I've confirmed MyLoginUser executes, so I think I have the vm files and at
> least the action.login property set correctly.  When I go to log in to the
> site, however, users aren't authenticated properly and I can't gain access
> to the site.
>
> I suspected that somehow I was not doing everything I was supposed to in
> simply extending LoginUser.  So, I copied and pasted the exact source for
> org.apache.turbine.modules.actions.LoginUser into MyLoginUser.java and
made
> the appropriate changes for it to compile, thinking that by extending
Action
> directly I would fix it.  However, the same problem occurs - MyLoginUser
> gets executed, but the users that previously were properly authenticated
via
> LoginUser are not logged in via MyLoginUser.  And this is where
MyLoginUser
> and LoginUser have IDENTICAL code save the classname and location in the
> source tree.
>
> Does anyone have any ideas or hints?  Am I missing a crucial step in the
> sequence I initially outlined?  Does it matter where MyLoginUser resides
> (it's currently in my application's modules/actions directory)?  I'm using
> TDK 2.1 with turbine-2.1.jar and velocity-1.2-dev.jar.
>
> Thanks,
> Derek
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>