]> git.mxchange.org Git - jfinancials-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 21:14:59 +0000 (23:14 +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/addressbook/beans/login/AddressbookUserLoginWebSessionBean.java
src/java/org/mxchange/addressbook/beans/login/AddressbookUserLoginWebSessionController.java
src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java
src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestController.java
src/java/org/mxchange/localization/bundle_de_DE.properties
src/java/org/mxchange/localization/bundle_en_US.properties
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 5caebaea1e54574fccc7a78dd6d68e9dc4b91223..749a5d9cd94e93b75d3fb214e15600175bfdb67b 100644 (file)
@@ -268,6 +268,11 @@ public class AddressbookUserLoginWebSessionBean extends BaseAddressbookControlle
                return UserUtils.ifPasswordMatches(container, this.getLoggedInUser());
        }
 
+       @Override
+       public boolean ifUserMustChangePassword () {
+               return (this.isUserLoggedIn() && this.getLoggedInUser().getUserMustChangePassword());
+       }
+
        @Override
        public boolean isInvisible () {
                // Check on login
index a4b7615b8a9d4499e62e495a60b7a06aed9a8658..826c6a2125ac0750b43cc9c1abc6c8727c7f2d04 100644 (file)
@@ -83,6 +83,13 @@ public interface AddressbookUserLoginWebSessionController 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 13ec9882fe2eaf8c0eb7b6d73589a45bfec888b9..7a3a50d0b0a7c5964d3a6a1a92ffa503be18e5d2 100644 (file)
@@ -110,6 +110,11 @@ public class AddressbookAdminUserWebRequestBean extends BaseAddressbookControlle
        @Any
        private Event<AdminLinkedUserEvent> userLinkedEvent;
 
+       /**
+        * Flag whether user must change password after login
+        */
+       private Boolean userMustChangePassword;
+
        /**
         * User name
         */
@@ -375,6 +380,16 @@ public class AddressbookAdminUserWebRequestBean extends BaseAddressbookControlle
                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 b8ddc311c79076215108bf3498562ee27e8c3f22..e9bace4e1182a9c75b0c8e5bfbd82c61330f3bb0 100644 (file)
@@ -91,4 +91,18 @@ public interface AddressbookAdminUserWebRequestController 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 14a4e5b3417ceb67dca6d99fe2c30a1e22175268..e156691fe9306a784f52434c054d11dfdef4eff3 100644 (file)
@@ -614,3 +614,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 6b2f3059fb7aed00367b2f096107a934a1abc1aa..f90b02e391c2c100e44f251e438b69d0f60f972c 100644 (file)
@@ -543,7 +543,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
@@ -612,3 +611,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 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 086090973d19c9a5a7163ee307f1863d8cba2e15..5be9181274c2ff56b46bb94773d3d11d75acf575 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 1bd39597128141ff7afdd3dc1419247ca0f965f5..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="#{loginController.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 59fae4fee000ab884a7ea5192bcbc297b70499e6..c9f812376808e5e658d2a5ad0f5de53d3902917c 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{loginController.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 b8c7fb11ea4a2e57cde628c0c9d1aa5ac619dbf7..b6e4638597d3417f215036ee196526ad39275a5b 100644 (file)
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{loginController.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>