]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Continued a bit: (please cherry-pick)
authorRoland Häder <roland@mxchange.org>
Mon, 1 Aug 2016 15:57:56 +0000 (17:57 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 6 Aug 2016 19:39:57 +0000 (21:39 +0200)
- basicly added (unfinished) setting flag "user must change password"

Signed-off-by: Roland Häder <roland@haeder.net>
Signed-off-by: Roland Häder <roland@mxchange.org>
13 files changed:
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionBean.java
src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionController.java
src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java
src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestController.java
web/WEB-INF/templates/admin/user/admin_form_user_data.tpl
web/user/login_change_email_address.xhtml
web/user/login_change_personal_data.xhtml
web/user/login_contact_data_saved.xhtml
web/user/login_edit_user_data.xhtml
web/user/login_index.xhtml
web/user/login_user_data_saved.xhtml

index 9391dc66c04891c6662b74cba4e3693df714911b..afa6b61aff0e3b3b75cc7561c85e204e2f1ce143 100644 (file)
@@ -586,3 +586,4 @@ ADMIN_COUNTRY_I18N_KEY_REQUIRED=Bitte geben Sie den Schl\u00fcssel f\u00fcr das
 ADMIN_COUNTRY_CODE_REQUIRED=Bitte geben Sie den L\u00e4ndercode ein (z.B. DE f\u00fcr Deutschland).
 ADMIN_COUNTRY_ABORAD_DIAL_PREFIX_REQUIRED=Bitte geben Sie die Vorwahl f\u00fcr Auslandsgespr\u00e4che ein (z.B. + oder 00).
 ADMIN_MOBILE_PROVIDER_DIAL_PREFIX_REQUIRED=Bitte geben Sie die Vorwahl ohne f\u00fchrende Null f\u00fcr den Mobilfunkanbieter ein (z.B. 177 f\u00fcr E+).
+USER_LOGIN_MUST_CHANGE_PASSWORD=Sie m\u00fcssen Ihr Passwort \u00e4ndern. Dies darf nicht mit dem aktuellen \u00fcbereinstimmen.
index 81da7b8f1ce5f15dd63ab17177d39590026132ab..1e1c4bcea1aecfa4e3ebb046c30ef9e2ccb0215a 100644 (file)
@@ -501,7 +501,6 @@ ADMIN_CONTACT_FAX_NUMBER=Fax number:
 PAGE_TITLE_ADMIN_EXPORT_CONTACT=Export contact data
 CONTENT_TITLE_ADMIN_EXPORT_CONTACT=Export contact data:
 ADMIN_EXPORT_CONTACTS_TITLE=Start data export
-#Bei sehr gro\u00dfen Datenmengen kann es eventuell zu Zeit\u00fcberschreitungen kommen. Daher sollten Sie besser seitenweise exportieren.
 ADMIN_EXPORT_CONTACTS_TIMEOUT_WARNING=Big data amount may lead to timeouts. You should then try to export each page separately.
 BUTTON_ADMIN_EXPORT_CONTACTS_CSV=Export all data as CSV file
 BUTTON_ADMIN_EXPORT_CONTACTS_XLS=Export all data as Excel file
@@ -570,3 +569,4 @@ ADMIN_COUNTRY_I18N_KEY_REQUIRED=Please enter the key for the language package (e
 ADMIN_COUNTRY_CODE_REQUIRED=Please enter country code (e.g. US for U.S.A.).
 ADMIN_COUNTRY_ABORAD_DIAL_PREFIX_REQUIRED=Please enter dial prefix for abroad calls (e.g. + or 00).
 ADMIN_MOBILE_PROVIDER_DIAL_PREFIX_REQUIRED=Please enter dial prefix for mobile provider.
+USER_LOGIN_MUST_CHANGE_PASSWORD=Please change your password. It must not match with your current one.
index cfe2d7da45bd7232a66b1be51cfc6c0b0db3bd1f..a6bb388f1ba48f168847d1c3b8d6712eeb5df737 100644 (file)
@@ -254,6 +254,11 @@ public class PizzaUserLoginWebSessionBean extends BasePizzaController implements
                return UserUtils.ifPasswordMatches(container, this.getLoggedInUser());
        }
 
+       @Override
+       public boolean ifUserMustChangePassword () {
+               return (this.isUserLoggedIn() && this.getLoggedInUser().getUserMustChangePassword());
+       }
+
        @Override
        public boolean isInvisible () {
                // Check on login
index b71a3f43600422f32e2f6928e515bf6df75c1d45..71af8157bb099598c5baaa09e19a1eadce0196d8 100644 (file)
@@ -83,6 +83,13 @@ public interface PizzaUserLoginWebSessionController extends Serializable {
         */
        boolean isUserLoggedIn ();
 
+       /**
+        * Checks whether the user needs to change password
+        * <p>
+        * @return Whether the user needs to change password
+        */
+       boolean ifUserMustChangePassword ();
+
        /**
         * Whether the currently logged-in user is invisible
         * <p>
index 74b127eb8bb0be7ead3d141aa92f489927ac1065..14c5ca597346528f2c7e5032a788a793ee56ce45 100644 (file)
@@ -110,6 +110,11 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements
        @Any
        private Event<AdminLinkedUserEvent> userLinkedEvent;
 
+       /**
+        * Flag whether user must change password after login
+        */
+       private Boolean userMustChangePassword;
+
        /**
         * User name
         */
@@ -375,6 +380,16 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements
                this.userName = userName;
        }
 
+       @Override
+       public Boolean getUserMustChangePassword () {
+               return this.userMustChangePassword;
+       }
+
+       @Override
+       public void setUserMustChangePassword (final Boolean userMustChangePassword) {
+               this.userMustChangePassword = userMustChangePassword;
+       }
+
        @Override
        public String getUserPassword () {
                return this.userPassword;
index 68ca7f5c4219a99583c404ce802f35d16cf5d3f7..f9c7941657ceb93d4c1ec366e9fb60679adc97b8 100644 (file)
@@ -91,4 +91,18 @@ public interface PizzaAdminUserWebRequestController extends Serializable {
         */
        void setUserPasswordRepeat (final String userPasswordRepeat);
 
+       /**
+        * Getter for flag if user needs to change password
+        * <p>
+        * @return Flag if user needs to change password
+        */
+       Boolean getUserMustChangePassword ();
+
+       /**
+        * Setter for flag if user needs to change password
+        * <p>
+        * @param userMustChangePassword Flag if user needs to change password
+        */
+       void setUserMustChangePassword (final Boolean userMustChangePassword);
+
 }
index 511af3b08f105b28e8483d537088641b38754c22..e8b209de9ea57b8278a4552c39b5a5bd88148b13 100644 (file)
                                        <div class="clear"></div>
                                </div>
 
+                               <div class="table_row">
+                                       <div class="table_left_medium">
+                                               <h:outputLabel for="userMustChangePassword" value="#{msg.ADMIN_USER_MUST_CHANGE_PASSWORD}" />
+                                       </div>
+
+                                       <div class="table_right_medium">
+                                               <h:selectBooleanCheckbox styleClass="input" id="userMustChangePassword" value="#{adminUserController.userMustChangePassword}" />
+                                       </div>
+
+                                       <div class="clear"></div>
+                               </div>
+
                                <div class="para notice">
                                        <ul>
                                                <li>
index 8e86d06f3328671bd980edcc3b966e8bced78c96..3fb7ca98c028f37026ec50a1334ab5e777500853 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn()}">
-                               <ui:fragment rendered="#{featureController.isFeatureEnabled('edit_user_data')}">
-                                       <div class="table">
-                                               <div class="table_header">
-                                                       <h:outputText value="#{msg.LOGIN_CHANGE_EMAIL_ADDRESS_TITLE}" />
-                                               </div>
-
-                                               <h:form id="login_change_email_address_form">
-                                                       <div class="para">
-                                                               <fieldset id="change_email">
-                                                                       <legend title="#{msg.LOGIN_CHANGE_EMAIL_LEGEND_TITLE}">
-                                                                               <h:outputText value="#{msg.LOGIN_CHANGE_EMAIL_LEGEND}" />
-                                                                       </legend>
+                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn() and featureController.isFeatureEnabled('edit_user_data') and not userLoginController.ifUserMustChangePassword()}">
+                               <div class="table">
+                                       <div class="table_header">
+                                               <h:outputText value="#{msg.LOGIN_CHANGE_EMAIL_ADDRESS_TITLE}" />
+                                       </div>
 
-                                                                       <div class="table_row">
-                                                                               <div class="table_left">
-                                                                                       <h:outputText value="#{msg.LOGIN_CHANGE_EMAIL_OLD_ADDRESS}" />
-                                                                               </div>
+                                       <h:form id="login_change_email_address_form">
+                                               <div class="para">
+                                                       <fieldset id="change_email">
+                                                               <legend title="#{msg.LOGIN_CHANGE_EMAIL_LEGEND_TITLE}">
+                                                                       <h:outputText value="#{msg.LOGIN_CHANGE_EMAIL_LEGEND}" />
+                                                               </legend>
 
-                                                                               <div class="table_right">
-                                                                                       <h:outputText value="#{contactController.emailAddress}" />
-                                                                               </div>
+                                                               <div class="table_row">
+                                                                       <div class="table_left">
+                                                                               <h:outputText value="#{msg.LOGIN_CHANGE_EMAIL_OLD_ADDRESS}" />
+                                                                       </div>
 
-                                                                               <div class="clear"></div>
+                                                                       <div class="table_right">
+                                                                               <h:outputText value="#{contactController.emailAddress}" />
                                                                        </div>
 
-                                                                       <ui:include src="/WEB-INF/templates/login/user/user_change_email_address_repeat_fields.tpl" />
-                                                               </fieldset>
-                                                       </div>
+                                                                       <div class="clear"></div>
+                                                               </div>
 
-                                                       <ui:include src="/WEB-INF/templates/login/login_enter_current_password.tpl" />
-                                               </h:form>
-                                       </div>
+                                                               <ui:include src="/WEB-INF/templates/login/user/user_change_email_address_repeat_fields.tpl" />
+                                                       </fieldset>
+                                               </div>
+
+                                               <ui:include src="/WEB-INF/templates/login/login_enter_current_password.tpl" />
+
+                                               <div class="table_footer">
+                                                       <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+                                                       <h:commandButton class="submit" type="submit" id="change_email" value="#{msg.BUTTON_CHANGE_EMAIL_ADDRESS}" action="#{emailChangeController.doChangeEmailAddress()}" />
+                                               </div>
+                                       </h:form>
+                               </div>
+                       </ui:fragment>
+
+                       <h:outputText styleClass="errors" value="#{msg.ERROR_LOGIN_USER_EDIT_DATA_DISABLED}" rendered="#{not featureController.isFeatureEnabled('edit_user_data')}" />
 
-                                       <h:outputText styleClass="errors" value="#{msg.ERROR_LOGIN_USER_EDIT_DATA_DISABLED}" rendered="#{not featureController.isFeatureEnabled('edit_user_data')}" />
-                               </ui:fragment>
+                       <ui:fragment rendered="#{userLoginController.ifUserMustChangePassword()}">
+                               <h:link outcome="user_change_password" value="#{msg.USER_LOGIN_MUST_CHANGE_PASSWORD}" />
+                       </ui:fragment>
 
-                               <ui:fragment rendered="#{not loginController.isUserLoggedIn()}">
-                                       <ui:include id="login_only" src="/WEB-INF/templates/generic/user_not_logged_in.tpl" />
-                               </ui:fragment>
+                       <ui:fragment rendered="#{not loginController.isUserLoggedIn()}">
+                               <ui:include id="login_only" src="/WEB-INF/templates/generic/user_not_logged_in.tpl" />
+                       </ui:fragment>
                </ui:define>
        </ui:composition>
 </html>
index 85693ac4596b310c88e29d44850c4b0cfe01c4f2..ee9f01fad60d7e0eadce812c03cfaf6293a3af6f 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn()}">
-                               <ui:fragment rendered="#{featureController.isFeatureEnabled('edit_user_data')}">
-                                       <div class="table">
-                                               <div class="table_header">
-                                                       <h:outputText value="#{msg.LOGIN_CHANGE_PERSONAL_DATA_TITLE}" />
-                                               </div>
+                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn() and featureController.isFeatureEnabled('edit_user_data') and not userLoginController.ifUserMustChangePassword()}">
+                               <div class="table">
+                                       <div class="table_header">
+                                               <h:outputText value="#{msg.LOGIN_CHANGE_PERSONAL_DATA_TITLE}" />
+                                       </div>
 
-                                               <h:form id="login_change_personal_form">
-                                                       <ui:include src="/WEB-INF/templates/contact/form_contact_data.tpl" />
+                                       <h:form id="login_change_personal_form">
+                                               <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:include src="/WEB-INF/templates/login/user/user_enter_current_password.tpl" />
 
-                                                       <ui:include src="/WEB-INF/templates/guest/guest_privacy_terms.tpl" />
+                                               <ui:include src="/WEB-INF/templates/guest/guest_privacy_terms.tpl" />
 
-                                                       <div class="table_footer">
-                                                               <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
-                                                               <h:commandButton styleClass="submit" type="submit" id="change_personal_data" value="#{msg.BUTTON_CHANGE_PERSONAL_DATA}" action="#{userController.doChangePersonalData()}" />
-                                                       </div>
-                                               </h:form>
-                                       </div>
-                               </ui:fragment>
+                                               <div class="table_footer">
+                                                       <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+                                                       <h:commandButton styleClass="submit" type="submit" id="change_personal_data" value="#{msg.BUTTON_CHANGE_PERSONAL_DATA}" action="#{userController.doChangePersonalData()}" />
+                                               </div>
+                                       </h:form>
+                               </div>
+                       </ui:fragment>
+
+                       <h:outputText styleClass="errors" value="#{msg.ERROR_LOGIN_USER_EDIT_DATA_DISABLED}" rendered="#{not featureController.isFeatureEnabled('edit_user_data')}" />
 
-                               <h:outputText styleClass="errors" value="#{msg.ERROR_LOGIN_USER_EDIT_DATA_DISABLED}" rendered="#{not featureController.isFeatureEnabled('edit_user_data')}" />
+                       <ui:fragment rendered="#{userLoginController.ifUserMustChangePassword()}">
+                               <h:link outcome="user_change_password" value="#{msg.USER_LOGIN_MUST_CHANGE_PASSWORD}" />
                        </ui:fragment>
 
                        <ui:fragment rendered="#{not userLoginController.isUserLoggedIn()}">
index 3fdb2d38db9617be5ce90bcac8052ee6775c25e1..5948703982a2bd263c6ef8817edbaeb52ef47287 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn()}">
-                               <ui:fragment rendered="#{featureController.isFeatureEnabled('edit_user_data')}">
-                                       <ui:include src="/WEB-INF/templates/generic/message_box.tpl">
-                                               <ui:param name="message" value="#{msg.LOGIN_MESSAGE_DATA_SAVED}" />
-                                       </ui:include>
-                               </ui:fragment>
+                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn() and featureController.isFeatureEnabled('edit_user_data') and not userLoginController.ifUserMustChangePassword()}">
+                               <ui:include src="/WEB-INF/templates/generic/message_box.tpl">
+                                       <ui:param name="message" value="#{msg.LOGIN_MESSAGE_DATA_SAVED}" />
+                               </ui:include>
+                       </ui:fragment>
 
+                       <ui:fragment rendered="#{userLoginController.ifUserMustChangePassword()}">
+                               <h:link outcome="user_change_password" value="#{msg.USER_LOGIN_MUST_CHANGE_PASSWORD}" />
                        </ui:fragment>
 
                        <h:outputText styleClass="errors" value="#{msg.ERROR_LOGIN_USER_EDIT_DATA_DISABLED}" rendered="#{not featureController.isFeatureEnabled('edit_user_data')}" />
index 0d6c0fc1d9166e9b1d8625929e798cba2b7d78c2..1270ebf058eac4d72db8cd92277615f3057382d4 100644 (file)
@@ -2,10 +2,10 @@
 <html
        lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
        xmlns="http://www.w3.org/1999/xhtml"
-         xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
-         xmlns:h="http://xmlns.jcp.org/jsf/html"
-         xmlns:f="http://xmlns.jcp.org/jsf/core"
-         >
+       xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+       xmlns:h="http://xmlns.jcp.org/jsf/html"
+       xmlns:f="http://xmlns.jcp.org/jsf/core"
+       >
 
        <ui:composition template="/WEB-INF/templates/login/user/user_base.tpl">
                <ui:define name="login_title">#{msg.PAGE_TITLE_LOGIN_EDIT_USER_DATA}</ui:define>
@@ -15,7 +15,7 @@
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn()}">
+                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn() and not userLoginController.ifUserMustChangePassword()}">
                                <div class="table">
                                        <div class="table_header">
                                                <h:outputText value="#{msg.LOGIN_EDIT_USER_DATA_TITLE}" />
 
                                        <div class="para">
                                                <ul>
-                                                       <li>
-                                                               <h:link title="#{msg.LINK_LOGIN_CHANGE_PERSONAL_DATA_TITLE}" outcome="login_change_personal_data" value="#{msg.LINK_LOGIN_CHANGE_PERSONAL_DATA}" />
-                                                       </li>
-                                                       <li>
-                                                               <h:link title="#{msg.LINK_LOGIN_CHANGE_EMAIL_ADDRESS_TITLE}" outcome="login_change_email_address" value="#{msg.LINK_LOGIN_CHANGE_EMAIL_ADDRESS}" />
-                                                       </li>
-                                                       <li>
-                                                               <h:link title="#{msg.LINK_LOGIN_CHANGE_PASSWORD_TITLE}" outcome="login_change_password" value="#{msg.LINK_LOGIN_CHANGE_PASSWORD}" />
-                                                       </li>
+                                                       <ui:fragment rendered="#{featureController.isFeatureEnabled('edit_user_data') and not userLoginController.ifUserMustChangePassword()}">
+                                                               <li>
+                                                                       <h:link title="#{msg.LINK_LOGIN_CHANGE_PERSONAL_DATA_TITLE}" outcome="login_change_personal_data" value="#{msg.LINK_LOGIN_CHANGE_PERSONAL_DATA}" />
+                                                               </li>
+                                                       </ui:fragment>
+
+                                                       <ui:fragment rendered="#{featureController.isFeatureEnabled('edit_user_data') and not userLoginController.ifUserMustChangePassword()}">
+                                                               <li>
+                                                                       <h:link title="#{msg.LINK_LOGIN_CHANGE_EMAIL_ADDRESS_TITLE}" outcome="login_change_email_address" value="#{msg.LINK_LOGIN_CHANGE_EMAIL_ADDRESS}" />
+                                                               </li>
+                                                       </ui:fragment>
+
+                                                       <ui:fragment rendered="#{featureController.isFeatureEnabled('edit_user_data')}">
+                                                               <li>
+                                                                       <h:link title="#{msg.LINK_LOGIN_CHANGE_PASSWORD_TITLE}" outcome="login_change_password" value="#{msg.LINK_LOGIN_CHANGE_PASSWORD}" />
+                                                               </li>
+                                                       </ui:fragment>
                                                </ul>
                                        </div>
                                </div>
index 8954954a39b849e93d063422627dc884cec9c6c1..c9f812376808e5e658d2a5ad0f5de53d3902917c 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn()}">
+                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn() and not userLoginController.ifUserMustChangePassword()}">
                                Here goes your content.
                        </ui:fragment>
 
+                       <ui:fragment rendered="#{userLoginController.ifUserMustChangePassword()}">
+                               <h:link outcome="user_change_password" value="#{msg.USER_LOGIN_MUST_CHANGE_PASSWORD}" />
+                       </ui:fragment>
+
                        <ui:fragment rendered="#{not userLoginController.isUserLoggedIn()}">
                                <ui:include src="/WEB-INF/templates/user/user_not_logged_in.tpl" />
                        </ui:fragment>
index 91fcd108ad7a1f1b7d8872c2490e228a0be94111..b6e4638597d3417f215036ee196526ad39275a5b 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn()}">
+                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn() and not userLoginController.ifUserMustChangePassword()}">
                                <ui:include src="/WEB-INF/templates/generic/message_box.tpl">
                                        <ui:param name="message" value="#{msg.LOGIN_MESSAGE_DATA_SAVED}" />
                                </ui:include>
                        </ui:fragment>
 
+                       <ui:fragment rendered="#{userLoginController.ifUserMustChangePassword()}">
+                               <h:link outcome="user_change_password" value="#{msg.USER_LOGIN_MUST_CHANGE_PASSWORD}" />
+                       </ui:fragment>
+
                        <ui:fragment rendered="#{not userLoginController.isUserLoggedIn()}">
                                <ui:include src="/WEB-INF/templates/user/user_not_logged_in.tpl" />
                        </ui:fragment>