show protected profile after password change

This commit is contained in:
Peter Hormanns 2021-12-07 20:12:47 +01:00
parent 694d20e4b7
commit ffa11c0e58
2 changed files with 7 additions and 2 deletions

View File

@ -108,6 +108,8 @@ public class ProfileServlet extends AbstractLDAPServlet {
usersDAO.update(usr);
httpSession.setAttribute("successmessage", messages.getString("ProfileServlet.password_changed"));
httpSession.setAttribute("operation", "profile");
httpSession.setAttribute("formdisabled", "disabled");
httpSession.setAttribute("iddisabled", "disabled");
httpSession.setAttribute("user", usr);
req.getRequestDispatcher("/user.jsp").forward(req, resp);
}

View File

@ -96,7 +96,6 @@ public class ResetPasswordServlet extends AbstractLDAPServlet {
final UsersDAO usrDAO = new UsersDAO(ldapSession);
final String loginParam = req.getParameter("login");
final User sessUsr = (User) httpSession.getAttribute("user");
// final MailboxDAO hsMailboxDAO = new MailboxDAO(getTicketProvider());
if (loginParam != null && sessUsr != null && loginParam.equals(sessUsr.getLogin())) {
final String password1 = req.getParameter("password");
final String password2 = req.getParameter("password2");
@ -110,7 +109,11 @@ public class ResetPasswordServlet extends AbstractLDAPServlet {
sessUsr.setAndValidatePassword(password1);
usrDAO.update(sessUsr);
httpSession.setAttribute("successmessage", messages.getString("ResetPasswordServlet.password_changed"));
req.getRequestDispatcher("/new-password.jsp").forward(req, resp);
httpSession.setAttribute("operation", "profile");
httpSession.setAttribute("formdisabled", "disabled");
httpSession.setAttribute("iddisabled", "disabled");
httpSession.setAttribute("user", sessUsr);
req.getRequestDispatcher("/user.jsp").forward(req, resp);
return;
} catch (SimplePasswordException e) {
httpSession.setAttribute("user", sessUsr);