]> git.mxchange.org Git - jjobs-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Mon, 29 Aug 2016 15:13:06 +0000 (17:13 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 29 Aug 2016 17:34:19 +0000 (19:34 +0200)
- nope, was not working, the login-controller still needs it to compare it with current user's

src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestController.java
web/WEB-INF/templates/login/user/user_enter_current_password.tpl
web/user/login_change_password.xhtml
web/user/login_change_personal_data.xhtml

index ae3eafc453b6104e946af3df8b703fc7256b322a..031308318ea50d3fab8109191b7930feb3f3c686 100644 (file)
@@ -65,11 +65,6 @@ public class JobsUserPasswordWebRequestBean extends BaseJobsController implement
         */
        private final UserSessionBeanRemote userBean;
 
-       /**
-        * Current password (for confirmation of password change)
-        */
-       private String userCurrentPassword;
-
        /**
         * Login controller (bean)
         */
@@ -125,7 +120,7 @@ public class JobsUserPasswordWebRequestBean extends BaseJobsController implement
                } 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
 
@@ -143,7 +138,7 @@ public class JobsUserPasswordWebRequestBean extends BaseJobsController implement
 
                        // 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
 
@@ -193,16 +188,6 @@ public class JobsUserPasswordWebRequestBean extends BaseJobsController implement
                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;
@@ -223,10 +208,11 @@ public class JobsUserPasswordWebRequestBean extends BaseJobsController implement
                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) &&
index 3104b9fbff927fce4d37eade0b46751f03c10191..a47f00b5897549c0396a84edd021bc79145123cd 100644 (file)
@@ -41,20 +41,6 @@ public interface JobsUserPasswordWebRequestController extends Serializable {
         */
        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>
@@ -70,7 +56,16 @@ public interface JobsUserPasswordWebRequestController extends Serializable {
        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
         */
index 8c6e2ecee0b1759a4bda0ba294d5b8b334a3296e..15dda796cb3f4fd95012e682b967843d314fba1a 100644 (file)
@@ -5,14 +5,6 @@
        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}">
@@ -25,7 +17,7 @@
                                        </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>
@@ -38,5 +30,4 @@
                                </div>
                        </fieldset>
                </div>
-       </ui:fragment>
 </ui:composition>
index ea8d8f73a5907dc2c6d02943325e763c3b840a06..dc647b75027143a7434c02c5860ab863723a1f36 100644 (file)
@@ -70,9 +70,7 @@
                                                        </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}" />
index 6e338d095f223717cc605efbc028b07a74a8b890..f8ec40bb9cbc5f31431dce3a4dedde99a805c2d4 100644 (file)
@@ -25,9 +25,7 @@
                                <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" />