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;
@Any
private Event<AdminLinkedUserEvent> userLinkedEvent;
+ /**
+ * User lock reason
+ */
+ private String userLockReason;
+
/**
* Flag whether user must change password after login
*/
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;
this.userPasswordRepeat = userPasswordRepeat;
}
- /**
- * Post-initialization of this class
- */
- @PostConstruct
- public void init () {
- }
-
/**
* Clears this bean
*/
<ui:define name="content">
<h:outputText styleClass="errors" value="#{msg.ERROR_USER_ID_NOT_FOUND}" rendered="#{empty beanHelper.user}" />
- <h:form id="form_admin_user_unlock">
-
+ <h:form id="form_admin_user_unlock" rendered="#{not empty beanHelper.user}">
+ <div class="table">
+ <div class="table_header">
+ <h:outputFormat value="#{msg.ADMIN_UNLOCK_USER_TITLE}">
+ <f:param value="#{beanHelper.user.userId}" />
+ <f:param value="#{beanHelper.user.userName}" />
+ </h:outputFormat>
+ </div>
+
+ <div class="table_row">
+ <div class="table_left25">
+ <h:outputLabel for="contactGender" value="#{msg.PERSONAL_DATA_GENDER}" />
+ </div>
+
+ <div class="table_right75">
+ <h:outputText id="contactGender" value="#{msg[beanHelper.user.userContact.contactGender.messageKey]}" />
+ </div>
+ </div>
+
+ <div class="table_row">
+ <div class="table_left25">
+ <h:outputLabel for="contactFirstName" value="#{msg.PERSONAL_DATA_FIRST_NAME}" />
+ </div>
+
+ <div class="table_right75">
+ <h:outputText id="contactFirstName" value="#{beanHelper.user.userContact.contactFirstName}" />
+ </div>
+ </div>
+
+ <div class="table_row">
+ <div class="table_left25">
+ <h:outputLabel for="contactFamilyName" value="#{msg.PERSONAL_DATA_FAMILY_NAME}" />
+ </div>
+
+ <div class="table_right75">
+ <h:outputText id="contactFamilyName" value="#{beanHelper.user.userContact.contactFamilyName}" />
+ </div>
+ </div>
+
+ <div class="table_row">
+ <div class="table_left25">
+ <h:outputLabel for="userLockReason" value="#{msg.ADMIN_ENTER_USER_LOCK_REASON}" />
+ </div>
+
+ <div class="table_right75">
+ <h:inputTextarea id="userLockReason" value="#{adminUserController.userLockReason}" cols="30" rows="20" required="true" requiredMessage="#{msg.ADMIN_USER_UNLOCK_REASON_REQUIRED}" />
+
+ <h:outputText value="#{adminUserController.userLockReason}" />
+
+ <h:outputText value="#{msg.ERROR_CANNOT_UN_LOCK_USER_ACCOUNT_UNCONFIRMED}" rendered="#{beanHelper.user.userAccountStatus == UserAccountStatus.UNCONFIRMED}" />
+ </div>
+ </div>
+
+ <div class="table_footer">
+ <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+
+ <h:commandButton styleClass="submit" type="submit" action="#{adminUserController.lockUserAccount()}" value="#{msg.BUTTON_ADMIN_LOCK_USER_ACCOUNT}" rendered="#{beanHelper.user.userAccountStatus == UserAccountStatus.CONFIRMED}" />
+
+ <h:commandButton styleClass="submit" type="submit" action="#{adminUserController.unlockUserAccount()}" value="#{msg.BUTTON_ADMIN_UNLOCK_USER_ACCOUNT}" rendered="#{beanHelper.user.userAccountStatus == UserAccountStatus.LOCKED}" />
+
+ <h:outputText value="#{msg.ERROR_CANNOT_UN_LOCK_USER_ACCOUNT_UNCONFIRMED}" rendered="#{beanHelper.user.userAccountStatus == UserAccountStatus.UNCONFIRMED}" />
+ </div>
+ </div>
</h:form>
</ui:define>
</ui:composition>