if (!this.userLoginController.isUserLoggedIn()) {
// Not logged-in
throw new IllegalStateException("User is not logged-in"); //NOI18N
+ } else if (!this.featureController.isFeatureEnabled("user_change_email_address")) { //NOI18N
+ // Editing is not allowed
+ throw new IllegalStateException("User tried to change email address"); //NOI18N
} else if (!this.isRequiredChangeEmailAddressSet()) {
// Not all required fields are set
throw new FaceletException("Not all required fields are set."); //NOI18N
} else if (!Objects.equals(this.getEmailAddress(), this.getEmailAddressRepeat())) {
// Email address 1+2 mismatch
- throw new FaceletException("Email address 1/2 are mismatching."); //NOI18N
+ this.showFacesMessage("form_user_change_email_address:emailAddressRepeat", "ERROR_USER_EMAIL_ADDRESSES_MISMATCH"); //NOI18N
+ return ""; //NOI18N
} else if (!this.userLoginController.ifCurrentPasswordMatches()) {
// Password not matching
- this.showFacesMessage("form_login_change_email_address:currentPassword", "ERROR_USER_CURRENT_PASSWORD_MISMATCHING"); //NOI18N
+ this.showFacesMessage("form_user_change_email_address:currentPassword", "ERROR_USER_CURRENT_PASSWORD_MISMATCHING"); //NOI18N
return ""; //NOI18N
- } else if (!this.featureController.isFeatureEnabled("edit_user_data")) { //NOI18N
- // Editing is not allowed
- throw new IllegalStateException("User tried to edit personal data"); //NOI18N
}
// Get user instance
// Check if the email address is already enqueued
if (this.isEmailAddressQueued(this.getEmailAddress())) {
+ // Clear both email addresses
+ this.setEmailAddress(null);
+ this.setEmailAddressRepeat(null);
+
// Yes, then abort here
- return "login_email_already_added"; //NOI18N
+ this.showFacesMessage("form_user_change_email_address:emailAddress", "ERROR_USER_CHANGE_EMAIL_ADDRESS_ALREADY_QUEUED"); //NOI18N
+ return ""; //NOI18N
}
// Create change object, to save EJB calls, the hash is not generated here
ADMIN_USER_PASSWORD_REPEAT_DIFFERENT=Your both entered passwords don't match.
ADMIN_USER_NAME_ALREADY_EXISTS=Your entered user name does already exist in other user account.
ADMIN_USER_ENTERED_SAME_AS_OLD_PASSWORD=You have not changed the password (same as stored entered)
+PAGE_TITLE_USER_LOGIN_CHANGE_PASSWORD=Change your user account password
+CONTENT_TITLE_USER_LOGIN_CHANGE_PASSWORD=Here you can change your user account password:
+USER_MUST_CHANGE_PASSWORD_NOTICE=You have to change your password as this is requested by the administrator. After successful change, you can use your account as usual.
+LOGIN_CHANGE_PASSWORD_TITLE=Change your password:
+LOGIN_CHANGE_PASSWORD_LEGEND=Please enter twice the new password:
+#Das neue Passwort muss zweimal eingegeben werden, um Tippfehler auszuschlie\u00dfen. Dabei darf es mit bereits verwendeten Passw\u00f6rtern nicht \u00fcbereinstimmen.
+LOGIN_CHANGE_PASSWORD_LEGEND_TITLE=The new password must be entered twice to avoid typing mistakes. It still must not match older passwords.
+ERROR_LOGIN_USER_CHANGE_EMAIL_ADDRESS_DISABLED=Changing of user's email address is administratively deactivated.
+#Die von Ihnen eingegebene Email-Adresse hatten Sie bereits zum \u00c4ndern eingegeben. Bitte melden Sie sich beim Support.
+ERROR_USER_CHANGE_EMAIL_ADDRESS_ALREADY_QUEUED=You have already entered the email address for changing. Please report to support.
+ERROR_USER_EMAIL_ADDRESSES_MISMATCH=Your both entered email addresses are mismatching.
ADMIN_USER_PASSWORD_REPEAT_DIFFERENT=Die beiden von Ihnen eingegebenen Passw\u00f6rter stimmen nicht \u00fcberein.
ADMIN_USER_NAME_ALREADY_EXISTS=Der von Ihnen eingegebene Benutzername existiert bereits (anderes Benutzeraccount).
ADMIN_USER_ENTERED_SAME_AS_OLD_PASSWORD=Sie haben das Passwort nicht ge\u00e4ndert (selibiges wie gespeichertes).
+PAGE_TITLE_USER_LOGIN_CHANGE_PASSWORD=\u00c4ndern Ihres Zugangspasswortes
+CONTENT_TITLE_USER_LOGIN_CHANGE_PASSWORD=\u00c4ndern Sie hier Ihr Zugangspasswort:
+USER_MUST_CHANGE_PASSWORD_NOTICE=Sie m\u00fcssen Ihr Passwort \u00e4ndern, da dies vom Administrator so vorgegeben ist. Danach k\u00f6nnen Sie Ihren Account wieder normal verwenden.
+LOGIN_CHANGE_PASSWORD_TITLE=\u00c4ndern Sie Ihr Passwort:
+LOGIN_CHANGE_PASSWORD_LEGEND=Bitte zweimal das neue Passwort eingeben:
+LOGIN_CHANGE_PASSWORD_LEGEND_TITLE=Das neue Passwort muss zweimal eingegeben werden, um Tippfehler auszuschlie\u00dfen. Dabei darf es mit bereits verwendeten Passw\u00f6rtern nicht \u00fcbereinstimmen.
+ERROR_LOGIN_USER_CHANGE_EMAIL_ADDRESS_DISABLED=Das \u00c4ndern der Email-Adresse ist administrativ deaktiviert worden.
+ERROR_USER_CHANGE_EMAIL_ADDRESS_ALREADY_QUEUED=Die von Ihnen eingegebene Email-Adresse hatten Sie bereits zum \u00c4ndern eingegeben. Bitte melden Sie sich beim Support.
+ERROR_USER_EMAIL_ADDRESSES_MISMATCH=Die von Ihnen eingegebenen Email-Adressen stimmen nicht \u00fcberein.
<from-view-id>/user/login_index.xhtml</from-view-id>
<navigation-case>
<from-outcome>user_change_password</from-outcome>
- <to-view-id>/user/login_change_password</to-view-id>
+ <to-view-id>/user/login_change_password.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
</ui:fragment>
</ul>
- <ui:fragment rendered="#{featureController.isFeatureEnabled('edit_user_data')}">
+ <ui:fragment rendered="#{featureController.isFeatureEnabled('edit_user_data') or featureController.isFeatureEnabled('change_user_password') or featureController.isFeatureEnabled('user_change_email_address')}">
<div class="menu_header">
<h:outputText value="#{msg.MENU_EDIT_PROFILE_TITLE}" />
</div>
<description>An application for handling and sending out applications to companies.</description>
<display-name>JJobs v1.0</display-name>
<context-param>
+ <description>Project stage.</description>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<param-name>is_debug_register_enabled</param-name>
<param-value>false</param-value>
</context-param>
+ <context-param>
+ <description>Whether users can change their email address.</description>
+ <param-name>is_feature_user_must_change_email_address_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>
</ui:define>
<ui:define name="content">
- <h:panelGroup styleClass="table" layout="block" rendered="#{userLoginController.isUserLoggedIn() and featureController.isFeatureEnabled('edit_user_data') and (not userLoginController.ifUserMustChangePassword() or not featureController.isFeatureEnabled('user_must_change_password'))}">
+ <h:panelGroup styleClass="table" layout="block" rendered="#{userLoginController.isUserLoggedIn() and featureController.isFeatureEnabled('user_change_email_address')}">
<div class="table_header">
<h:outputText value="#{msg.LOGIN_CHANGE_EMAIL_ADDRESS_TITLE}" />
</div>
- <h:form id="form_login_change_email_address">
+ <h:form id="form_user_change_email_address">
<div class="para">
<fieldset class="fieldset" id="change_email">
<legend title="#{msg.LOGIN_CHANGE_EMAIL_LEGEND_TITLE}">
</h:form>
</h:panelGroup>
- <ui:fragment rendered="#{not featureController.isFeatureEnabled('edit_user_data')}">
+ <ui:fragment rendered="#{not featureController.isFeatureEnabled('user_change_email_address')}">
<ui:include src="/WEB-INF/templates/generic/message_box.tpl">
- <ui:param name="message" value="#{msg.ERROR_LOGIN_USER_EDIT_DATA_DISABLED}" />
+ <ui:param name="message" value="#{msg.ERROR_LOGIN_USER_CHANGE_EMAIL_ADDRESS_DISABLED}" />
<ui:param name="styleClass" value="errors" />
</ui:include>
</ui:fragment>
- <ui:fragment rendered="#{userLoginController.ifUserMustChangePassword()}">
- <h:link outcome="user_change_password" value="#{msg.USER_LOGIN_MUST_CHANGE_PASSWORD}" />
- </ui:fragment>
-
- <ui:fragment rendered="#{not loginController.isUserLoggedIn()}">
- <ui:include id="login_only" src="/WEB-INF/templates/generic/user_not_logged_in.tpl" />
+ <ui:fragment rendered="#{not userLoginController.isUserLoggedIn()}">
+ <ui:include id="login_only" src="/WEB-INF/templates/user/user_not_logged_in.tpl" />
</ui:fragment>
</ui:define>
</ui:composition>
</ui:define>
<ui:define name="content">
+ <ui:fragment rendered="#{userLoginController.loggedInUser.userMustChangePassword == true}">
+ <ui:include src="/WEB-INF/templates/generic/message_box.tpl">
+ <ui:param name="message" value="#{msg.USER_MUST_CHANGE_PASSWORD_NOTICE}" />
+ </ui:include>
+ </ui:fragment>
+
<ui:fragment rendered="#{userLoginController.isUserLoggedIn()}">
<h:panelGroup styleClass="table" layout="block" rendered="#{featureController.isFeatureEnabled('change_user_password')}">
<div class="table_header">
<div class="table_row">
<div class="table_left">
- <h:outputLabel for="userCurrentPassword" value="#{msg.GUEST_REGISTRATION_ENTER_CURRENT_PASSWORD}" />
- </div>
-
- <div class="table_right">
- <h:inputSecret styleClass="input" id="userCurrentPassword" size="10" maxlength="255" value="#{userPasswordController.userCurrentPassword}" required="true" requiredMessage="#{msg.USER_CURRENT_PASSWORD_REQUIRED}" />
- </div>
-
- <div class="clear"></div>
-
- <h:panelGroup styleClass="error_container" layout="block">
- <h:message for="userCurrentPassword" errorClass="errors" fatalClass="errors" warnClass="errors" />
- </h:panelGroup>
- </div>
-
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel for="userPassword" value="#{msg.GUEST_REGISTRATION_ENTER_PASSWORD}" />
+ <h:outputLabel for="userPassword" value="#{msg.USER_ENTER_PASSWORD}" />
</div>
<div class="table_right">
<div class="table_row">
<div class="table_left">
- <h:outputLabel for="userPasswordRepeat" value="#{msg.GUEST_REGISTRATION_ENTER_PASSWORD_REPEAT}" />
+ <h:outputLabel for="userPasswordRepeat" value="#{msg.USER_ENTER_PASSWORD_REPEAT}" />
</div>
<div class="table_right">
</div>
<div class="clear"></div>
-
- <h:panelGroup styleClass="error_container" layout="block">
- <h:message for="userCurrentPassword" errorClass="errors" fatalClass="errors" warnClass="errors" />
- </h:panelGroup>
</div>
+
+ <h:panelGroup styleClass="error_container" layout="block">
+ <h:message for="userCurrentPassword" errorClass="errors" fatalClass="errors" warnClass="errors" />
+ </h:panelGroup>
</fieldset>
</div>
</li>
</ui:fragment>
- <ui:fragment rendered="#{featureController.isFeatureEnabled('edit_user_data') and (not userLoginController.ifUserMustChangePassword() or not featureController.isFeatureEnabled('user_must_change_password'))}">
+ <ui:fragment rendered="#{featureController.isFeatureEnabled('edit_user_data') and (not userLoginController.ifUserMustChangePassword() or not featureController.isFeatureEnabled('user_must_change_email_address'))}">
<li>
<h:link title="#{msg.LINK_LOGIN_CHANGE_EMAIL_ADDRESS_TITLE}" outcome="login_change_email_address" value="#{msg.LINK_LOGIN_CHANGE_EMAIL_ADDRESS}" />
</li>