> -----Original Message-----
> From: Bill [mailto:bhalpin@;collaborativefusion.com]
> 
> Has anyone ever had a problem using the stock LoginUser class after
> extending TurbineUser?

yes.  =)
 
> The first conditional block in doPerform gets a non-null user 
> and causes
> LoginUser to return:
> 
>       // This prevents a db hit on second Action call during page
>         // generation.  Turbine removes everything from the Session
>         // before calling this method, so in this case we should
>         // continue on with the Login procedure.
> 
>       if (data.getUserFromSession() != null)
>       {
>               return;
>       }
> 
> No matter what, that conditional always seems to be true even though I
> have not successfully logged in with that block included in 
> the class. 
> If I comment that block out I seem to login fine (I have not gone very
> far in testing this but it does go to the correct page and I've
> successfully pulled info from the resulting user object).
> 
> In the comment it mentions Turbine removing 'everything from the
> Session' before it calls this method...what method is being 
> referred to
> here?  Does this mean that Turbine removes everything from the Session
> before running doPerform or getUserFromSession?  
> 
> Obviously removing that block will add a performance burden if it
> unnecessarily hits the db a second time, but does anyone know of any
> other pitfalls that I might be opening up by removing it?  

i'm unsure about pitfalls but i did encounter similar issues when i
attempted to login using the extended TurbineUser.  only, i /needed/ to
retain the session data between the anonymous user and the logged in
user[1].  like you, i discovered that the anonymous user sessions was never
null, and hence the (data.getUserFromSession() != null ) conditional was
always true.

a solution i found for this was to check instead for
(data.getUserFromSession.getUserName != null) in my own LoginUserAction
class, which merely replicated the base functionality in LoginUser.  the
action.login entry in tr.props was also commented /out/, so the session was
not cleared.

i'm not quite sure of the repercussions of this, but for now it works for
me...

this may not be exactly what you were after, i know, but i do know a lot of
people encounter issues with this aspect of extending TurbineUser and if it
can help someone, it'll be worth it!

- brydon

[1] this was for a cart system where a user could fill a cart and /then/ log
in, retaining the cart information.

--
brydon cheyney
senior analyst programmer
2fluid_creative ltd
w: www.2fluid.co.uk

Reply via email to