hi,
i've been attempting to implement my own login class and so far have been
unsuccessful. i've tried delving into the mailing lists, but can't find
anything which solves my problem...
the reason i wish to implement my own login class is that i need to retain
some of the session data across logins. the actual data is from a shopping
cart, and i'd like this to persist across the initial 'anonymous' user to
the logged in user.
at first i attemped to extend LoginUser, overriding doPerform(Rundata) and
calling super.doPerform(RunData) from within the method. however, i
discovered the RunData object was not the correct one - it was missing
several items from the Context, especially the session based Cart tool. i
have no idea why this is the case...
second, i tried removing the action.login from the TR.props file and have my
custom login class extend SecureAction instead, a la 'regular' actions. in
the doPerform method i implemented [ok, copied... ;)] the code from
Turbine's LoginUser class. this retained the correct context, but would not
log a user in! it seems to return on [from LoginUser.java ]
-- code --
if ( data.getUserFromSession() != null ) {
return;
}
-- end --
apparently as the user in the session is the initial 'anonymous' User. so
it is /not/ null in this instance.
.
..
... [away trying something]
..
.
ok, i now have it working! i changed the code to the following as a valid
user will /always/ have a username set.
-- code --
if ( data.getUserFromSession().getUserName() != null ) {
return;
}
-- end --
but why does this work in the vanilla LoginUser.class? and why does the
LoginUser.java class lose the context?
any help, or list archive references i've missed, would be most appreciated.
many thanks [and apologies for the rambling],
brydon
--
Brydon Cheyney
Senior Analyst Programmer
2fluid_creative ltd
w: www.2fluid.co.uk