import org.mxchange.jusercore.events.user.password_change.UpdatedUserPasswordEvent;
import org.mxchange.jusercore.events.user.password_change.UserUpdatedPasswordEvent;
import org.mxchange.jusercore.exceptions.UserNotFoundException;
-import org.mxchange.jusercore.exceptions.UserPasswordMismatchException;
import org.mxchange.jusercore.exceptions.UserStatusLockedException;
import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException;
import org.mxchange.jusercore.model.user.User;
// Not all required fields are set
throw new FaceletException("Not all required fields are set."); //NOI18N
} else if (!this.userLoginController.ifCurrentPasswordMatches()) {
- // Password not matching
- throw new FaceletException(new UserPasswordMismatchException(this.userLoginController.getLoggedInUser()));
- } else if (!this.featureController.isFeatureEnabled("change_user_password")) { //NOI18N
- // Editing is not allowed
- throw new IllegalStateException("User tried to change password."); //NOI18N
- } else if (!UserUtils.ifPasswordMatches(this.userLoginController.getUserCurrentPassword(), this.userLoginController.getLoggedInUser())) {
// Password mismatches
this.showFacesMessage("form_user_change_password:userCurrentPassword", "ERROR_USER_CURRENT_PASSWORD_MISMATCHING"); //NOI18N
// No redirect
return ""; //NOI18N
+ } else if (!this.featureController.isFeatureEnabled("change_user_password")) { //NOI18N
+ // Editing is not allowed
+ throw new IllegalStateException("User tried to change password."); //NOI18N
} else if (!Objects.equals(this.getUserPassword(), this.getUserPasswordRepeat())) {
// Both entered passwords don't match
this.showFacesMessage("form_user_change_password:userPasswordRepeat", "ERROR_USER_NEW_PASSWORDS_MISMATCH"); //NOI18N