From b0265c5e340e64e644d8b336bc86b1876fb775aa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 1 Aug 2016 17:57:56 +0200 Subject: [PATCH] Continued a bit: (please cherry-pick) - basicly added (unfinished) setting flag "user must change password" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder Signed-off-by: Roland Häder --- .../localization/bundle_de_DE.properties | 1 + .../localization/bundle_en_US.properties | 2 +- .../login/PizzaUserLoginWebSessionBean.java | 5 ++ .../PizzaUserLoginWebSessionController.java | 7 ++ .../user/PizzaAdminUserWebRequestBean.java | 15 ++++ .../PizzaAdminUserWebRequestController.java | 14 ++++ .../admin/user/admin_form_user_data.tpl | 12 ++++ web/user/login_change_email_address.xhtml | 72 ++++++++++--------- web/user/login_change_personal_data.xhtml | 38 +++++----- web/user/login_contact_data_saved.xhtml | 13 ++-- web/user/login_edit_user_data.xhtml | 36 ++++++---- web/user/login_index.xhtml | 6 +- web/user/login_user_data_saved.xhtml | 6 +- 13 files changed, 154 insertions(+), 73 deletions(-) diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index 9391dc66..afa6b61a 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -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. diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index 81da7b8f..1e1c4bce 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -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. diff --git a/src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionBean.java b/src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionBean.java index cfe2d7da..a6bb388f 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionBean.java @@ -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 diff --git a/src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionController.java b/src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionController.java index b71a3f43..71af8157 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/login/PizzaUserLoginWebSessionController.java @@ -83,6 +83,13 @@ public interface PizzaUserLoginWebSessionController extends Serializable { */ boolean isUserLoggedIn (); + /** + * Checks whether the user needs to change password + *

+ * @return Whether the user needs to change password + */ + boolean ifUserMustChangePassword (); + /** * Whether the currently logged-in user is invisible *

diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java index 74b127eb..14c5ca59 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java @@ -110,6 +110,11 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements @Any private Event 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; diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestController.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestController.java index 68ca7f5c..f9c79416 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestController.java @@ -91,4 +91,18 @@ public interface PizzaAdminUserWebRequestController extends Serializable { */ void setUserPasswordRepeat (final String userPasswordRepeat); + /** + * Getter for flag if user needs to change password + *

+ * @return Flag if user needs to change password + */ + Boolean getUserMustChangePassword (); + + /** + * Setter for flag if user needs to change password + *

+ * @param userMustChangePassword Flag if user needs to change password + */ + void setUserMustChangePassword (final Boolean userMustChangePassword); + } diff --git a/web/WEB-INF/templates/admin/user/admin_form_user_data.tpl b/web/WEB-INF/templates/admin/user/admin_form_user_data.tpl index 511af3b0..e8b209de 100644 --- a/web/WEB-INF/templates/admin/user/admin_form_user_data.tpl +++ b/web/WEB-INF/templates/admin/user/admin_form_user_data.tpl @@ -52,6 +52,18 @@

+
+
+ +
+ +
+ +
+ +
+
+
  • diff --git a/web/user/login_change_email_address.xhtml b/web/user/login_change_email_address.xhtml index 8e86d06f..3fb7ca98 100644 --- a/web/user/login_change_email_address.xhtml +++ b/web/user/login_change_email_address.xhtml @@ -15,46 +15,54 @@ - - -
    -
    - -
    - - -
    -
    - - - + +
    +
    + +
    -
    -
    - -
    + +
    +
    + + + -
    - -
    +
    +
    + +
    -
    +
    +
    - -
    -
    +
    +
    - - -
    + +
    +
    + + + + +
    +
    +
    + + - -
    + + + - - - + + +
    diff --git a/web/user/login_change_personal_data.xhtml b/web/user/login_change_personal_data.xhtml index 85693ac4..ee9f01fa 100644 --- a/web/user/login_change_personal_data.xhtml +++ b/web/user/login_change_personal_data.xhtml @@ -15,29 +15,31 @@ - - -
    -
    - -
    + +
    +
    + +
    - - + + - + - + - - -
    -
    + + +
    +
    + + - + + diff --git a/web/user/login_contact_data_saved.xhtml b/web/user/login_contact_data_saved.xhtml index 3fdb2d38..59487039 100644 --- a/web/user/login_contact_data_saved.xhtml +++ b/web/user/login_contact_data_saved.xhtml @@ -15,13 +15,14 @@
    - - - - - - + + + + + + + diff --git a/web/user/login_edit_user_data.xhtml b/web/user/login_edit_user_data.xhtml index 0d6c0fc1..1270ebf0 100644 --- a/web/user/login_edit_user_data.xhtml +++ b/web/user/login_edit_user_data.xhtml @@ -2,10 +2,10 @@ + xmlns:ui="http://xmlns.jcp.org/jsf/facelets" + xmlns:h="http://xmlns.jcp.org/jsf/html" + xmlns:f="http://xmlns.jcp.org/jsf/core" + > #{msg.PAGE_TITLE_LOGIN_EDIT_USER_DATA} @@ -15,7 +15,7 @@ - +
    @@ -27,15 +27,23 @@
      -
    • - -
    • -
    • - -
    • -
    • - -
    • + +
    • + +
    • +
      + + +
    • + +
    • +
      + + +
    • + +
    • +
    diff --git a/web/user/login_index.xhtml b/web/user/login_index.xhtml index 8954954a..c9f81237 100644 --- a/web/user/login_index.xhtml +++ b/web/user/login_index.xhtml @@ -15,10 +15,14 @@ - + Here goes your content. + + + + diff --git a/web/user/login_user_data_saved.xhtml b/web/user/login_user_data_saved.xhtml index 91fcd108..b6e46385 100644 --- a/web/user/login_user_data_saved.xhtml +++ b/web/user/login_user_data_saved.xhtml @@ -15,12 +15,16 @@ - + + + + + -- 2.39.5