]> git.mxchange.org Git - addressbook-war.git/commitdiff
Continued a bit: (please cherry-pick)
authorRoland Häder <roland@mxchange.org>
Tue, 2 Aug 2016 09:25:04 +0000 (11:25 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 6 Aug 2016 21:15:26 +0000 (23:15 +0200)
- that the user must change password enforced by administrator may be not wanted everywhere, so better make it as a feature that can be disabled per project
- ignored some strings for i18n

Signed-off-by: Roland Häder <roland@haeder.net>
src/java/org/mxchange/addressbook/beans/login/AddressbookUserLoginWebSessionBean.java
web/WEB-INF/templates/admin/user/admin_form_user_data.tpl
web/WEB-INF/web.xml
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 749a5d9cd94e93b75d3fb214e15600175bfdb67b..50beb849017ce7c4f82bf27609e78712b7665e3c 100644 (file)
@@ -58,12 +58,12 @@ public class AddressbookUserLoginWebSessionBean extends BaseAddressbookControlle
        /**
         * Path name for guest base template
         */
-       private static final String GUEST_BASE_TEMPLATE_NAME = "guest/guest";
+       private static final String GUEST_BASE_TEMPLATE_NAME = "guest/guest"; //NOI18N
 
        /**
         * Path name for logged-in user base template
         */
-       private static final String USER_BASE_TEMPLATE_NAME = "login/user/user";
+       private static final String USER_BASE_TEMPLATE_NAME = "login/user/user"; //NOI18N
 
        /**
         * Serial number
index e8b209de9ea57b8278a4552c39b5a5bd88148b13..ae979a96222ae79c7b42ac0bdd8f4adfb815317c 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>
+                               <ui:fragment rendered="#{featureController.isFeatureEnabled('user_must_change_password')}">
+                                       <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="table_right_medium">
+                                                       <h:selectBooleanCheckbox styleClass="input" id="userMustChangePassword" value="#{adminUserController.userMustChangePassword}" />
+                                               </div>
 
-                                       <div class="clear"></div>
-                               </div>
+                                               <div class="clear"></div>
+                                       </div>
+                               </ui:fragment>
 
                                <div class="para notice">
                                        <ul>
index 8fe1ee2c9fcd72a9653b715780a353f7f5455673..3e7ecd84b5d10a995845d837d91eac93e91cb167 100644 (file)
         <param-name>is_feature_privacy_enabled</param-name>
         <param-value>true</param-value>
     </context-param>
+    <context-param>
+        <description>Feature: Users must change password after login (with current password). Administrators can enforce this.</description>
+        <param-name>is_feature_user_must_change_password_enabled</param-name>
+        <param-value>true</param-value>
+    </context-param>
     <servlet>
         <servlet-name>Faces Servlet</servlet-name>
         <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
index 3fb7ca98c028f37026ec50a1334ab5e777500853..d42ad5a4a962cc6f8a80b9791512a68a707aa746 100644 (file)
@@ -15,7 +15,7 @@
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn() and featureController.isFeatureEnabled('edit_user_data') and not userLoginController.ifUserMustChangePassword()}">
+                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn() and featureController.isFeatureEnabled('edit_user_data') and (not userLoginController.ifUserMustChangePassword() or not featureController.isFeatureEnabled('user_must_change_password'))}">
                                <div class="table">
                                        <div class="table_header">
                                                <h:outputText value="#{msg.LOGIN_CHANGE_EMAIL_ADDRESS_TITLE}" />
index ee9f01fad60d7e0eadce812c03cfaf6293a3af6f..088c5581c62d22614f171cd209305366917a837f 100644 (file)
@@ -15,7 +15,7 @@
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn() and featureController.isFeatureEnabled('edit_user_data') and not userLoginController.ifUserMustChangePassword()}">
+                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn() and featureController.isFeatureEnabled('edit_user_data') and (not userLoginController.ifUserMustChangePassword() or not featureController.isFeatureEnabled('user_must_change_password'))}">
                                <div class="table">
                                        <div class="table_header">
                                                <h:outputText value="#{msg.LOGIN_CHANGE_PERSONAL_DATA_TITLE}" />
index 5be9181274c2ff56b46bb94773d3d11d75acf575..f33cf16a0af105f38350595e81d505dee8d360be 100644 (file)
@@ -15,7 +15,7 @@
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn() and featureController.isFeatureEnabled('edit_user_data') and not userLoginController.ifUserMustChangePassword()}">
+                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn() and featureController.isFeatureEnabled('edit_user_data') and (not userLoginController.ifUserMustChangePassword() or not featureController.isFeatureEnabled('user_must_change_password'))}">
                                <ui:include src="/WEB-INF/templates/generic/message_box.tpl">
                                        <ui:param name="message" value="#{msg.LOGIN_MESSAGE_DATA_SAVED}" />
                                </ui:include>
index 1270ebf058eac4d72db8cd92277615f3057382d4..fbdda7de93081e58ca35155b3add9edb773d2203 100644 (file)
@@ -15,7 +15,7 @@
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn() and not userLoginController.ifUserMustChangePassword()}">
+                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn() and (not userLoginController.ifUserMustChangePassword() or not featureController.isFeatureEnabled('user_must_change_password'))}">
                                <div class="table">
                                        <div class="table_header">
                                                <h:outputText value="#{msg.LOGIN_EDIT_USER_DATA_TITLE}" />
 
                                        <div class="para">
                                                <ul>
-                                                       <ui:fragment rendered="#{featureController.isFeatureEnabled('edit_user_data') and not userLoginController.ifUserMustChangePassword()}">
+                                                       <ui:fragment rendered="#{featureController.isFeatureEnabled('edit_user_data') and (not userLoginController.ifUserMustChangePassword() or not featureController.isFeatureEnabled('user_must_change_password'))}">
                                                                <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()}">
+                                                       <ui:fragment rendered="#{featureController.isFeatureEnabled('edit_user_data') and (not userLoginController.ifUserMustChangePassword() or not featureController.isFeatureEnabled('user_must_change_password'))}">
                                                                <li>
                                                                        <h:link title="#{msg.LINK_LOGIN_CHANGE_EMAIL_ADDRESS_TITLE}" outcome="login_change_email_address" value="#{msg.LINK_LOGIN_CHANGE_EMAIL_ADDRESS}" />
                                                                </li>
index c9f812376808e5e658d2a5ad0f5de53d3902917c..b85c6661c0a1bd55cb200dfd14a5b318225c7e91 100644 (file)
@@ -15,7 +15,7 @@
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn() and not userLoginController.ifUserMustChangePassword()}">
+                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn() and (not userLoginController.ifUserMustChangePassword() or not featureController.isFeatureEnabled('user_must_change_password'))}">
                                Here goes your content.
                        </ui:fragment>
 
index b6e4638597d3417f215036ee196526ad39275a5b..f0831d0bd1782e4fededc76025714536d6084b3b 100644 (file)
@@ -15,7 +15,7 @@
                </ui:define>
 
                <ui:define name="content">
-                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn() and not userLoginController.ifUserMustChangePassword()}">
+                       <ui:fragment rendered="#{userLoginController.isUserLoggedIn() and (not userLoginController.ifUserMustChangePassword() or not featureController.isFeatureEnabled('user_must_change_password'))}">
                                <ui:include src="/WEB-INF/templates/generic/message_box.tpl">
                                        <ui:param name="message" value="#{msg.LOGIN_MESSAGE_DATA_SAVED}" />
                                </ui:include>