- nope, was not working, the login-controller still needs it to compare it with current user's
*/
private final UserSessionBeanRemote userBean;
- /**
- * Current password (for confirmation of password change)
- */
- private String userCurrentPassword;
-
/**
* Login controller (bean)
*/
} 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.getUserCurrentPassword(), this.userLoginController.getLoggedInUser())) {
+ } 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 (Objects.equals(this.getUserCurrentPassword(), this.getUserPassword())) {
+ } else if (Objects.equals(this.userLoginController.getUserCurrentPassword(), this.getUserPassword())) {
// New password matches current
this.showFacesMessage("form_user_change_password:userPassword", "ERROR_USER_NEW_PASSWORD_SAME_AS_CURRENT"); //NOI18N
return "login_data_saved"; //NOI18N
}
- @Override
- public String getUserCurrentPassword () {
- return this.userCurrentPassword;
- }
-
- @Override
- public void setUserCurrentPassword (final String userCurrentPassword) {
- this.userCurrentPassword = userCurrentPassword;
- }
-
@Override
public String getUserPassword () {
return this.userPassword;
this.userPasswordRepeat = userPasswordRepeat;
}
+ @Override
public boolean isRequiredChangePasswordSet () {
// Is all data set?
- return ((this.getUserCurrentPassword() != null) &&
- (!this.getUserCurrentPassword().isEmpty()) &&
+ return ((this.userLoginController.getUserCurrentPassword() != null) &&
+ (!this.userLoginController.getUserCurrentPassword().isEmpty()) &&
(this.getUserPassword() != null) &&
(!this.getUserPassword().isEmpty()) &&
(this.getUserPasswordRepeat() != null) &&
*/
void setUserPassword (final String userPassword);
- /**
- * Getter for current unencrypted user password
- * <p>
- * @return Current unencrypted user password
- */
- String getUserCurrentPassword ();
-
- /**
- * Setter for current unencrypted user password
- * <p>
- * @param userCurrentPassword Current unencrypted user password
- */
- void setUserCurrentPassword (final String userCurrentPassword);
-
/**
* Getter for unencrypted user password repeated
* <p>
void setUserPasswordRepeat (final String userPasswordRepeat);
/**
- * Changes logged-in user's password. It must not match with current password and should not appear in password history list for X (configurable) entries.
+ * Checks whether all required "password-change fields" are set.
+ * <p>
+ * @return Whether the required fields are set
+ */
+ boolean isRequiredChangePasswordSet ();
+
+ /**
+ * Changes logged-in user's password. It must not match with current
+ * password and should not appear in password history list for X
+ * (configurable) entries.
* <p>
* @return Redirect outcome
*/
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
- <ui:fragment rendered="#{empty targetController}">
- <ui:include src="/WEB-INF/templates/generic/message_box.tpl">
- <ui:param name="message" value="#{msg.ERROR_PARAMETER_TARGET_CONTROLLER_NOT_SET}" />
- <ui:param name="styleClass" value="errors" />
- </ui:include>
- </ui:fragment>
-
- <ui:fragment rendered="#{not empty targetController}">
<div class="para">
<fieldset class="fieldset" id="current_password">
<legend title="#{msg.LOGIN_ENTER_CURRENT_PASSWORD_CONFIRMATION_LEGEND_TITLE}">
</div>
<div class="table_right">
- <h:inputSecret styleClass="input" id="currentPassword" size="10" maxlength="255" value="#{targetController.userCurrentPassword}" required="true" validatorMessage="#{msg.ERROR_USER_CURRENT_PASSWORD_MISMATCHING}">
+ <h:inputSecret styleClass="input" id="currentPassword" size="10" maxlength="255" value="#{userLoginController.userCurrentPassword}" required="true" validatorMessage="#{msg.ERROR_USER_CURRENT_PASSWORD_MISMATCHING}">
<!-- <f:validator for="currentPassword" validatorId="RecruiterUserPasswordValidator" /> //-->
</h:inputSecret>
</div>
</div>
</fieldset>
</div>
- </ui:fragment>
</ui:composition>
</fieldset>
</div>
- <ui:include src="/WEB-INF/templates/login/user/user_enter_current_password.tpl">
- <ui:param name="targetController" value="#{userPasswordController}" />
- </ui:include>
+ <ui:include src="/WEB-INF/templates/login/user/user_enter_current_password.tpl" />
<div class="table_footer">
<h:commandButton styleClass="reset right_space" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
<h:form id="form_login_change_personal">
<ui:include src="/WEB-INF/templates/contact/form_contact_data.tpl" />
- <ui:include src="/WEB-INF/templates/login/user/user_enter_current_password.tpl">
- <ui:param name="targetController" value="#{userLoginController}" />
- </ui:include>
+ <ui:include src="/WEB-INF/templates/login/user/user_enter_current_password.tpl" />
<ui:include src="/WEB-INF/templates/guest/guest_privacy_terms.tpl" />