{
session.addMessage("Passwords do not match!");
return "";
}
UserProfile p;
if( loginid.equals("--New--") )
{
// Create new user
p = mgr.getUserDatabase().newProfile();
p.setCreated( new Date() );
}
else
{
try
{
p = mgr.getUserDatabase().findByLoginName( loginid );
}
catch (NoSuchPrincipalException e)
{
session.addMessage("I could not find user profile "+loginid);
return "";
}
}
p.setEmail(email);
p.setFullname(fullname);
if( password != null && password.length() > 0 ) p.setPassword(password);
p.setLoginName(loginname);
try
{
mgr.getUserDatabase().save( p );
}