As below, and according to the docs, I should be able to perform the
cast:
TurbineUser tu = (TurbineUser)TutbineSecurity.getUser(name);
I continually get the null pointer exception:
java.lang.ClassCastException:
org.apache.turbine.om.security.TurbineUser
Any help -- please!
Cliff
-----Original Message-----
From: Lang, Cliff
Sent: Thursday, October 25, 2001 3:05 PM
To: [EMAIL PROTECTED]
Subject: Getting TurbineUser from the User returned by TurbineSecurity?
I need to update data in a secondary table whenever the password is
updated in TURBINE_USER. These tables have redundant data, but must be
there for historical reasons.
I setup foriegnKey ref from USER_INFO.ID => TURBINE_USER.USER_ID and the
reverse. What I want to do is return the ObjectKey from user, then use
it to grab my USER_INFO object. Then update the UserInfo object (ui)
using [ data.getParameters().setProperties(ui); ] (Is there a better
way to tie these two tables together?)
Torque made me a getUserInfo() function, if I could just get my
TurbineUser set correctly I think I'd be ok.. Here is what I've done,
the last part of the code doesn't work of course. The TURBINE_USER
table is updated correctly.
Thanks, Cliff
I am using the Flux UserAction, doUpdate() --
public void doUpdate(RunData data, Context context)
throws Exception
{
User user =
TurbineSecurity.getUser(data.getParameters().getString("username"));
String password = data.getParameters().getString("password");
data.getParameters().setProperties(user);
Date now = new Date();
password = Crypt.crypt(password);
//user.setModifiedDate(now);
user.setCreateDate(now);
user.setLastLogin(new Date(0));
user.setPassword(password);
TurbineSecurity.saveUser(user);
// ########## Up to here all is good ##########
// ########## Then I can't get my correct UserInfo object
##########
TurbineUser tu = (TurbineUser) user;
UserInfo ui = (UserInfo)tu.getUserInfo();
data.getParameters().setProperties(ui);
ui.save();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]