From a13e93b36d35c738063a29e88027df37fcdb0e8d 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 --- .../user/JobsAdminUserWebRequestBean.java | 23 ++++--- .../JobsAdminUserWebRequestController.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/jjobs/beans/user/JobsAdminUserWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java index c42f3f23..81436924 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java @@ -18,7 +18,6 @@ package org.mxchange.jjobs.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; @@ -101,6 +100,11 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J @Inject private JobsUserWebSessionController userController; + /** + * User lock reason + */ + private String userLockReason; + /** * Flag whether user must change password after login */ @@ -362,6 +366,16 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J 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; @@ -402,13 +416,6 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J this.userPasswordRepeat = userPasswordRepeat; } - /** - * Post-initialization of this class - */ - @PostConstruct - public void init () { - } - /** * Clears this bean */ diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestController.java b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestController.java index 3b3195d9..764e09db 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestController.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestController.java @@ -105,4 +105,18 @@ public interface JobsAdminUserWebRequestController 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 ccc4ae6b..0f324bf2 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -588,3 +588,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 2576df3b..60892224 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -588,3 +588,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