UserForm user = (UserForm) form;
super.validateClientId(request, user);
ActionMessages msgs = new ActionMessages();
while (msgs.isEmpty()) {
UserBean loginUser = super.getLoginUser(request, response);
if(loginUser == null) {
msgs.add("user", new ActionMessage("error.user_not_login"));
break;
}
if(loginUser.getId() != user.getId()){
msgs.add("user", new ActionMessage("error.access_deny"));
break;
}
UserBean ubean = UserDAO.getUserByID(user.getId());
if (ubean == null || ubean.getStatus()!=UserBean.STATUS_NORMAL) {
msgs.add("id", new ActionMessage("error.user_not_available",
new Integer(user.getId())));
break;
}
if (!StringUtils.equals(ubean.getPassword(), user
.getPassword())){
msgs.add("password",
new ActionMessage("error.user_auth_failed"));
break;
}
if(user.getRemovePortrait()==1)
ubean.setPortrait(null);
else{
String portrait_uri = handleUserPortrait(ubean.getId(), user.getPortrait());
if(StringUtils.isNotEmpty(portrait_uri))
ubean.setPortrait(portrait_uri);
}
try {
DLOGUserManager.update(ubean);
//����session�е��û�����
UserLoginManager.updateLoginUser(request, ubean);