Verwaltung von LDAP Accounts und Gruppen
Peter Hormanns
2021-12-07 ffa11c0e58f267615060e83d493f0033b8e97f9e
show protected profile after password change
2 files modified
9 ■■■■ changed files
src/main/java/de/jalin/ldapadmin/web/ProfileServlet.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/de/jalin/ldapadmin/web/ResetPasswordServlet.java 7 ●●●● patch | view | raw | blame | history
src/main/java/de/jalin/ldapadmin/web/ProfileServlet.java
@@ -108,6 +108,8 @@
                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);
            }
src/main/java/de/jalin/ldapadmin/web/ResetPasswordServlet.java
@@ -96,7 +96,6 @@
        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 @@
                        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);