Skip to content

Commit

Permalink
Merge branch 'kitodo:master' into filter-select
Browse files Browse the repository at this point in the history
  • Loading branch information
markusweigelt authored Dec 7, 2023
2 parents d392df7 + 2523d03 commit 4df4798
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
37 changes: 19 additions & 18 deletions Kitodo/src/main/java/org/kitodo/production/forms/UserForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -648,27 +648,28 @@ public static boolean checkUserLoggedIn(User user) {
public void changePasswordForCurrentUser() {
if (isOldPasswordInvalid()) {
Helper.setErrorMessage("passwordsDontMatchOld");
}
try {
Set<ConstraintViolation<KitodoPassword>> passwordViolations = getPasswordViolations();
if (passwordViolations.isEmpty()) {
if (DynamicAuthenticationProvider.getInstance().isLdapAuthentication()
&& Objects.nonNull(userObject.getLdapGroup())) {
ServiceManager.getLdapServerService().changeUserPassword(userObject, passwordToEncrypt);
} else {
} else {
try {
Set<ConstraintViolation<KitodoPassword>> passwordViolations = getPasswordViolations();
if (passwordViolations.isEmpty()) {
if (DynamicAuthenticationProvider.getInstance().isLdapAuthentication()
&& Objects.nonNull(userObject.getLdapGroup())) {
ServiceManager.getLdapServerService().changeUserPassword(userObject, passwordToEncrypt);
}
// NOTE: password has to be changed in database in any case because of a bug in LdapServerService
userService.changeUserPassword(userObject, this.passwordToEncrypt);
Helper.setMessage("passwordChanged");
PrimeFaces.current().executeScript("PF('resetPasswordDialog').hide();");
} else {
for (ConstraintViolation<KitodoPassword> passwordViolation : passwordViolations) {
Helper.setErrorMessage(passwordViolation.getMessage());
}
}
Helper.setMessage("passwordChanged");
PrimeFaces.current().executeScript("PF('resetPasswordDialog').hide();");
} else {
for (ConstraintViolation<KitodoPassword> passwordViolation : passwordViolations) {
Helper.setErrorMessage(passwordViolation.getMessage());
}
} catch (DAOException e) {
Helper.setErrorMessage(ERROR_SAVING, new Object[]{ObjectType.USER.getTranslationSingular()}, logger, e);
} catch (NoSuchAlgorithmException e) {
Helper.setErrorMessage("ldap error", logger, e);
}
} catch (DAOException e) {
Helper.setErrorMessage(ERROR_SAVING, new Object[] {ObjectType.USER.getTranslationSingular() }, logger, e);
} catch (NoSuchAlgorithmException e) {
Helper.setErrorMessage("ldap error", logger, e);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Kitodo/src/main/resources/messages/errors_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ errorParsingName="Parsingfehler: Vorname nicht mit Komma vom Nachnamen getrennt
errorProjectNoTitleGiven=Kein Titel angegeben. Ein Projekt kann nicht ohne Titel gespeichert werden.
paginationFormatError=Der Paginierungsstartwert "{0}" ist nicht dem gew\u00E4hlten Paginierungstyp entsprechend formatiert.
parameterMissing=Pflichtparameter {ID} nicht gefunden.
passwordsDontMatchOld=Das eingegebene Passwort stimmt nicht mit dem alten Passwort \u00FCberein!
passwordsDontMatchOld=Das alte Passwort ist nicht korrekt!
processAssignedError=Diese Produktionsvorlage kann nicht gel\u00F6scht werden, da dieser Vorg\u00E4nge zugewiesen sind.
processCreationErrorFieldIsEmpty={0} enth\u00E4lt keinen Wert.
processCreationErrorNoCollection=keine Kollektion angegeben.
Expand Down
1 change: 1 addition & 0 deletions Kitodo/src/main/resources/messages/errors_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ errorParsingName="Error parsing: First name not separated by comma from last nam
errorProjectNoTitleGiven=No project title was given. You cannot save a project without a title.
paginationFormatError=The pagination start value "{0}" is malformed according to selected pagination type.
parameterMissing=Mandatory parameter {ID} not found.
passwordsDontMatchOld=The old password is not correct!
processAssignedError=The template could not be deleted because there are already assigned processes.
processCreationErrorFieldIsEmpty={0} contains no value.
processCreationErrorNoCollection=no collection stated.
Expand Down

0 comments on commit 4df4798

Please sign in to comment.