fix external address password reset

This commit is contained in:
Peter Hormanns 2020-03-06 19:46:48 +01:00
parent ef095b7d2e
commit 7bfbf0b8c0

View File

@ -128,7 +128,10 @@ public class ResetPasswordServlet extends AbstractLDAPServlet {
for (User usr : allUsers) { for (User usr : allUsers) {
if (usr.getEmailInternal() != null && usr.getEmailInternal().equalsIgnoreCase(loginOrEMail)) { if (usr.getEmailInternal() != null && usr.getEmailInternal().equalsIgnoreCase(loginOrEMail)) {
login = usr.getLogin(); login = usr.getLogin();
email = usr.getEmailInternal(); email = usr.getEmailExternal();
if (email == null || email.isEmpty()) {
email = usr.getEmailInternal();
}
salutation = usr.getFirstname() + " " + usr.getLastname(); salutation = usr.getFirstname() + " " + usr.getLastname();
} }
} }
@ -136,7 +139,10 @@ public class ResetPasswordServlet extends AbstractLDAPServlet {
final User usr = usrDAO.read("uid=" + loginOrEMail + ",ou=users,"); final User usr = usrDAO.read("uid=" + loginOrEMail + ",ou=users,");
if (usr != null) { if (usr != null) {
login = usr.getLogin(); login = usr.getLogin();
email = usr.getEmailInternal(); email = usr.getEmailExternal();
if (email == null || email.isEmpty()) {
email = usr.getEmailInternal();
}
salutation = usr.getFirstname() + " " + usr.getLastname(); salutation = usr.getFirstname() + " " + usr.getLastname();
} }
} }