return (mapping.findForward(IConst.TOKEN.DENIED));
}
HttpSession session = request.getSession();
User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
UserDAO dao = UserDAO.getInstance();
try {
if (MD5Digest.digest( user.getName(),
((ChangePasswordForm) form).getPassword()
)
.equals(user.getPassword())) {
dao.changePassword(((ChangePasswordForm) form).getPassword1(),
user.getName());
log(request, "logs.LOG8");
user = dao.getUser(user.getName(),
((ChangePasswordForm) form).getPassword1());
if (IConst.VALUES.TRUE.equals(Configurator.getInstance().get(IConst.CONFIG.ENABLE_AUTO_LOGIN))) {
// set autolog cookies if needed...
if (user.getSettings().isAutologin()) {
Cookie userCookie = new Cookie(IConst.COOKIE.USER_COOKIE,
user.getName() + "*" + user.getPassword());
userCookie.setMaxAge(IConst.COOKIE.SECONDS_PER_YEAR);
((HttpServletResponse) response).addCookie(userCookie);
}
}
user.setIp(request.getRemoteAddr());
session.setAttribute(IConst.SESSION.USER_KEY, user);
setStatusMessage(request, "status.CH_PASS");
} else {
ActionErrors errors = new ActionErrors();
errors.add(ActionErrors.GLOBAL_ERROR,