]> git.mxchange.org Git - jjobs-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>
Sun, 7 Aug 2016 10:03:15 +0000 (12:03 +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>
Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jjobs/beans/login/JobsUserLoginWebSessionBean.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 31a76019d22ce9fa71009e4270e79dcecb0104ea..bad611038c9c81ce4bb819a313a36ed2bdb2282d 100644 (file)
@@ -51,6 +51,16 @@ import org.mxchange.jusercore.model.user.status.UserAccountStatus;
 @SessionScoped
 public class JobsUserLoginWebSessionBean extends BaseJobsController implements JobsUserLoginWebSessionController {
 
+       /**
+        * Path name for guest base template
+        */
+       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"; //NOI18N
+
        /**
         * Serial number
         */
@@ -215,6 +225,7 @@ public class JobsUserLoginWebSessionBean extends BaseJobsController implements J
 
                // Trace message
                // NOISY-DEBUG System.out.println(MessageFormat.format("JobsUserLoginWebSessionBean:isUserLoggedIn: this.userLoggedIn={0} - EXIT!", this.userLoggedIn));
+
                // Return it
                return this.userLoggedIn;
        }
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 4f4b592ffaccb8515cb3b8649cfac5dc1f57f3d3..37c28b0ee8bf3a5ffca9c565b7b96308f1b475b5 100644 (file)
         <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</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 fb3781ac266b28e0ab3258c2337be3f26c5f94f8..64a62680307985a5c1df304fb2d889560b4681a8 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 bc8b42e9096b882f1308a8d088c7f84dd9d1b9ae..98dd25c1b8272ebf9a3282c773760b2df47ab6e6 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>