From 2d55f0215f3cee7c84b4fd688d908f265074f86a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 4 Aug 2016 18:10:38 +0200 Subject: [PATCH] Continued with user locking: (please cherry-pick) - added form for un-/locking users + it shows buttons depending on if the user is lock/unlocked or unconfirmed + if the user is unconfirmed, a text is shown (maybe not wanted, easy to rewrite to a "feature") + if the user is locked, the reason is shown - added lock reason to controller (bean) - added missing 18n strings --- .../AddressbookAdminUserWebRequestBean.java | 23 ++++--- ...ressbookAdminUserWebRequestController.java | 14 ++++ .../localization/bundle_de_DE.properties | 2 + .../localization/bundle_en_US.properties | 2 + web/admin/user/admin_user_unlock.xhtml | 65 ++++++++++++++++++- 5 files changed, 96 insertions(+), 10 deletions(-) diff --git a/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java b/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java index d389b29c..4b12a3a2 100644 --- a/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestBean.java @@ -18,7 +18,6 @@ package org.mxchange.addressbook.beans.user; import java.text.MessageFormat; import java.util.Objects; -import javax.annotation.PostConstruct; import javax.enterprise.context.RequestScoped; import javax.enterprise.event.Event; import javax.enterprise.event.Observes; @@ -110,6 +109,11 @@ public class AddressbookAdminUserWebRequestBean extends BaseAddressbookControlle @Any private Event userLinkedEvent; + /** + * User lock reason + */ + private String userLockReason; + /** * Flag whether user must change password after login */ @@ -371,6 +375,16 @@ public class AddressbookAdminUserWebRequestBean extends BaseAddressbookControlle return "admin_list_user"; //NOI18N } + @Override + public String getUserLockReason () { + return this.userLockReason; + } + + @Override + public void setUserLockReason (final String userLockReason) { + this.userLockReason = userLockReason; + } + @Override public Boolean getUserMustChangePassword () { return this.userMustChangePassword; @@ -411,13 +425,6 @@ public class AddressbookAdminUserWebRequestBean extends BaseAddressbookControlle this.userPasswordRepeat = userPasswordRepeat; } - /** - * Post-initialization of this class - */ - @PostConstruct - public void init () { - } - /** * Clears this bean */ diff --git a/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestController.java b/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestController.java index e9bace4e..7c452657 100644 --- a/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestController.java +++ b/src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebRequestController.java @@ -105,4 +105,18 @@ public interface AddressbookAdminUserWebRequestController extends Serializable { */ void setUserMustChangePassword (final Boolean userMustChangePassword); + /** + * Getter for user lock reason + *

+ * @return User lock reason + */ + String getUserLockReason (); + + /** + * Setter for user lock reason + *

+ * @param userLockReason User lock reason + */ + void setUserLockReason (final String userLockReason); + } diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index 954f2826..195e50b6 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -621,3 +621,5 @@ USER_CURRENT_PASSWORD_REQUIRED=Bitte geben Sie Ihr derzeit verwendetes Passwort USER_NEW_PASSWORD_REQUIRED=Bitte geben Sie ein neues Passwort zweimal ein. Dieses muss anders als Ihr aktuelles sein. USER_NEW_PASSWORD_REPEAT_REQUIRED=Bitte wiederholen Sie das neue Passwort. Dies dient der Reduzierung von Tippfehlern. ADMIN_USER_MUST_CHANGE_PASSWORD=Soll der Benutzer sein Kennwort nach dem Einloggen selber \u00e4ndern? +ERROR_CANNOT_UN_LOCK_USER_ACCOUNT_UNCONFIRMED=Fehler: Kann das Benutzerkonto nicht sperren oder entsperren, da es noch nicht best\u00e4tigt ist. +ADMIN_USER_UNLOCK_REASON_REQUIRED=Bitte geben Sie einen aussagekr\u00e4ftigen Grund f\u00fcr die Account-Sperre ein. diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index 80a200e3..9f6eb8ee 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -618,3 +618,5 @@ USER_CURRENT_PASSWORD_REQUIRED=Please enter your currently used password for con USER_NEW_PASSWORD_REQUIRED=Please a new password twice. This must be different than the current one. USER_NEW_PASSWORD_REPEAT_REQUIRED=Please repeat your new password. This is for preventing type mistakes. ADMIN_USER_MUST_CHANGE_PASSWORD=Should the user change his password after login? +ERROR_CANNOT_UN_LOCK_USER_ACCOUNT_UNCONFIRMED=Error: Cannot lock or unlock user account, it is still unconfirmed. +ADMIN_USER_UNLOCK_REASON_REQUIRED=Please provide a good reason why you want to lock this user's account. diff --git a/web/admin/user/admin_user_unlock.xhtml b/web/admin/user/admin_user_unlock.xhtml index 2e00380a..06f86a24 100644 --- a/web/admin/user/admin_user_unlock.xhtml +++ b/web/admin/user/admin_user_unlock.xhtml @@ -22,8 +22,69 @@ - - + +

+
+ + + + +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ + + + + +
+
+ + +
-- 2.39.5