uiApp.addMessage(new ApplicationMessage("UIAccountForm.msg.password-is-not-match", null, ApplicationMessage.ERROR));
return false;
}
String username = getUIStringInput(USERNAME).getValue();
if (newUser) {
User user = service.getUserHandler().createUserInstance(username);
invokeSetBindingField(user);
// user.setPassword(Util.encodeMD5(pass1x)) ;
if (service.getUserHandler().findUserByName(user.getUserName()) != null) {
Object[] args = { user.getUserName() };
uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.user-exist", args, ApplicationMessage.ERROR));
return false;
}
Query query = new Query();
query.setEmail(getUIStringInput("email").getValue());
if (service.getUserHandler().findUsers(query).getAll().size() > 0) {
Object[] args = { user.getUserName() };
uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.email-exist", args, ApplicationMessage.ERROR));
return false;
}
service.getUserHandler().createUser(user, true);
reset();
return true;
}
User user = service.getUserHandler().findUserByName(username);
invokeSetBindingField(user);
// user.setPassword(Util.encodeMD5(pass1x)) ;
service.getUserHandler().saveUser(user, true);
return true;
}