@Override
public boolean isEmailAddressRegistered (final Contact contact) {
+ // Cherck parameter
+ if (null == contact) {
+ // Throw NPE
+ throw new NullPointerException("contact is null"); //NOI18N
+ } else if (contact.getContactEmailAddress() == null) {
+ // Throw again
+ throw new NullPointerException("contact.contactEmailAddress is null"); //NOI18N
+ } else if (contact.getContactEmailAddress().isEmpty()) {
+ // Is empty
+ throw new IllegalArgumentException("contact.contactEmailAddress is empty."); //NOI18N
+ }
+
+ // Determine it
return ((this.emailAddressList instanceof List) && (this.emailAddressList.contains(contact.getContactEmailAddress())));
}
assert (user.getUserContact().getContactId() instanceof Long) : "Instance loginController.userContact.contactId is null"; //NOI18N
assert (user.getUserContact().getContactId() > 0) : MessageFormat.format("Instance loginController.userContact.contactId={0} is invalid", user.getUserContact().getContactId()); //NOI18N
- // Get dummy email address
- String dummyEmail = this.getEmailAddress();
-
- // Unset all so the user is forced to re-enter it
- this.clear();
-
// Check if the email address is already enqueued
- if (this.isEmailAddressQueued(dummyEmail)) {
+ if (this.isEmailAddressQueued(this.getEmailAddress())) {
// Yes, then abort here
return "login_email_already_added"; //NOI18N
}
// Create change object, to save EJB calls, the hash is not generated here
- ChangeableEmailAddress emailAddress = new EmailAddressChange(user, dummyEmail);
+ ChangeableEmailAddress emailChange = new EmailAddressChange(user, this.getEmailAddress());
// Call EJB
- this.emailBean.enqueueEmailAddressForChange(emailAddress);
+ this.emailBean.enqueueEmailAddressForChange(emailChange);
+
+ // Unset all so the user is forced to re-enter it
+ this.clear();
// All fine
return "login_email_change_queued"; //NOI18N
#TODO: Please fix German umlaut!
LOGIN_CHANGE_EMAIL_LEGEND_TITLE=Hier koennen Sie Ihre Email-Adresse aendern. Dazu muessen Sie diese zweimal eingeben und die neue Adresse bestaetigen.
LOGIN_CHANGE_EMAIL_OLD_ADDRESS=Ihre derzeitige Email-Adresse:
-LOGIN_CHANGE_EMAIL_ENTER_EMAIL1=Neue Email-Adresse eingeben:
-LOGIN_CHANGE_EMAIL_ENTER_EMAIL2=Neue Email-Adresse wiederholen:
+LOGIN_CHANGE_EMAIL_ENTER_EMAIL=Neue Email-Adresse eingeben:
+LOGIN_CHANGE_EMAIL_ENTER_EMAIL_REPEAT=Neue Email-Adresse wiederholen:
+#TODO: Please fix German umlaut!
+BUTTON_CHANGE_EMAIL_ADDRESS=Email-Adresse aendern
+#TODO: Please fix German umlaut!
+PAGE_TITLE_LOGIN_CHANGE_EMAIL_ADDRESS=Aendern Ihrer Email-Adresse
+CONTENT_TITLE_LOGIN_CHANGE_EMAIL_ADDRESS=Neue Email-Adresse eingeben:
+#TODO: Please fix German umlaut!
+PAGE_TITLE_LOGIN_CHANGE_PERSONAL_DATA=Ihre persoenlichen Daten aendern
+#TODO: Please fix German umlaut!
+CONTENT_TITLE_LOGIN_CHANGE_PERSONAL_DATA=Aendern Ihrer Adresse, Telefonnummer usw.:
+LOGIN_MESSAGE_DATA_SAVED=Daten wurden gespeichert.
+PAGE_TITLE_LOGIN_DATA_SAVED=Ihre Daten wurden gespeichert
+CONTENT_TITLE_LOGIN_DATA_SAVED=Daten wurden gespeichert:
+LOGIN_CHANGE_EMAIL_ADDRESS_TITLE=\u00c4ndern Sie Ihre Email-Adresse:
+LOGIN_CHANGE_EMAIL_LEGEND=Email-Adresse \u00e4ndern:
+LOGIN_CHANGE_EMAIL_LEGEND_TITLE=Hier k\u00f6nnen Sie Ihre Email-Adresse \u00e4ndern. Dazu m\u00fcssen Sie diese zweimal eingeben und die neue Adresse best\u00e4tigen.
+LOGIN_CHANGE_EMAIL_OLD_ADDRESS=Ihre derzeitige Email-Adresse:
#TODO: Please fix German umlaut!
BUTTON_CHANGE_EMAIL_ADDRESS=Email-Adresse aendern
#TODO: Please fix German umlaut!
LOGIN_CHANGE_EMAIL_LEGEND=Change email address:
LOGIN_CHANGE_EMAIL_LEGEND_TITLE=Here you can change your email address. You can do this by entering it twice and then confirm the new one.
LOGIN_CHANGE_EMAIL_OLD_ADDRESS=Your current email address:
-LOGIN_CHANGE_EMAIL_ENTER_EMAIL1=Enter new email address:
-LOGIN_CHANGE_EMAIL_ENTER_EMAIL2=Repeat new email address:
+LOGIN_CHANGE_EMAIL_ENTER_EMAIL=Enter new email address:
+LOGIN_CHANGE_EMAIL_ENTER_EMAIL_REPEAT=Repeat new email address:
BUTTON_CHANGE_EMAIL_ADDRESS=Change email address
PAGE_TITLE_LOGIN_CHANGE_EMAIL_ADDRESS=Change your email address
CONTENT_TITLE_LOGIN_CHANGE_EMAIL_ADDRESS=Enter new email address:
USER_ACCOUNT_STATUS_CONFIRMED=Confirmed
USER_ACCOUNT_STATUS_UNCONFIRMED=Unconfirmed
USER_ACCOUNT_STATUS_LOCKED=Locked
-USER_PROFILE_MODE_INVISIBLE=Invisible
-USER_PROFILE_MODE_MEMBERS=Only members
-USER_PROFILE_MODE_PUBLIC=Public
ADMIN_LINK_SHOW_USER_TITLE=Show administrative user profile
PAGE_TITLE_ADMIN_SHOW_USER=Show user profile
CONTENT_TITLE_ADMIN_SHOW_USER=Show profile of a user:
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<ui:composition
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
-
- <div class="para notice">
- #{msg.PERSONAL_DATA_MINIMUM_NOTICE}
- </div>
-
- <div class="para">
- <fieldset id="personal_data">
- <legend title="#{msg.PERSONAL_DATA_LEGEND_TITLE}">#{msg.PERSONAL_DATA_LEGEND}</legend>
-
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel for="gender" value="#{msg.PERSONAL_DATA_GENDER}" />
- </div>
-
- <div class="table_right">
- <ui:include src="/WEB-INF/templates/generic/gender_selection_box.tpl">
- <ui:param name="targetController" value="#{contactController}" />
- </ui:include>
- </div>
-
- <div class="clear"></div>
- </div>
-
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel for="firstName" value="#{msg.PERSONAL_DATA_FIRST_NAME}" />
- </div>
-
- <div class="table_right">
- <h:inputText styleClass="input" id="firstName" size="10" maxlength="255" value="#{contactController.firstName}" required="true">
- <f:validator for="firstName" validatorId="NameValidator" />
- </h:inputText>
- </div>
-
- <div class="clear"></div>
- </div>
-
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel for="familyName" value="#{msg.PERSONAL_DATA_FAMILY_NAME}" />
- </div>
-
- <div class="table_right">
- <h:inputText styleClass="input" id="familyName" size="10" maxlength="255" value="#{contactController.familyName}" required="true">
- <f:validator for="familyName" validatorId="NameValidator" />
- </h:inputText>
- </div>
-
- <div class="clear"></div>
- </div>
-
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel for="street" value="#{msg.PERSONAL_DATA_STREET}" />
- </div>
-
- <div class="table_right">
- <h:inputText styleClass="input" id="street" size="20" maxlength="255" value="#{contactController.street}" required="true">
- <f:validator for="street" validatorId="NameValidator" />
- </h:inputText>
- </div>
-
- <div class="clear"></div>
- </div>
-
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel for="houseNumber" value="#{msg.PERSONAL_DATA_HOUSE_NUMBER}" />
- </div>
-
- <div class="table_right">
- <h:inputText styleClass="input" id="houseNumber" size="3" maxlength="5" value="#{contactController.houseNumber}" required="true" validatorMessage="#{msg.ENTERED_HOUSE_NUMBER_INVALID}">
- <f:validateLongRange for="houseNumber" minimum="1" maximum="500" />
- </h:inputText>
- </div>
-
- <div class="clear"></div>
- </div>
-
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel for="zipCode" value="#{msg.PERSONAL_DATA_ZIP_CODE}" />
- </div>
-
- <div class="table_right">
- <h:inputText styleClass="input" id="zipCode" size="5" maxlength="6" value="#{contactController.zipCode}" required="true" validatorMessage="#{msg.ENTERED_ZIP_CODE_INVALID}">
- <f:validateLongRange for="zipCode" minimum="1" maximum="99999" />
- </h:inputText>
- </div>
-
- <div class="clear"></div>
- </div>
-
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel for="city" value="#{msg.PERSONAL_DATA_CITY}" />
- </div>
-
- <div class="table_right">
- <h:inputText styleClass="input" id="city" size="10" maxlength="255" value="#{contactController.city}" required="true">
- <f:validator for="city" validatorId="NameValidator" />
- </h:inputText>
- </div>
-
- <div class="clear"></div>
- </div>
-
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel for="country" value="#{msg.PERSONAL_DATA_COUNTRY_CODE}" />
- </div>
-
- <div class="table_right">
- <h:selectOneMenu styleClass="select" id="country" value="#{contactController.country}" converter="CountryConverter">
- <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
- <f:selectItems value="#{countryController.allCountries()}" var="c" itemValue="#{c}" itemLabel="#{c.countryCode} (#{msg[c.countryI18nkey]})" />
- </h:selectOneMenu>
- </div>
-
- <div class="clear"></div>
- </div>
-
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel value="#{msg.PERSONAL_DATA_PHONE_NUMBER}" />
- </div>
-
- <div class="table_right">
- <h:selectOneMenu styleClass="select" id="countryPhoneCode" value="#{contactController.phoneCountry}" converter="CountryConverter">
- <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
- <f:selectItems value="#{countryController.allCountries()}" var="c" itemValue="#{c}" itemLabel="#{c.countryAbroadDialPrefix}#{c.countryPhoneCode}" />
- </h:selectOneMenu>
-
- <h:inputText styleClass="input" id="phoneAreaCode" size="5" maxlength="10" value="#{contactController.phoneAreaCode}">
- <f:validator for="phoneAreaCode" validatorId="PhoneNumberValidator" />
- </h:inputText>
-
- <h:inputText styleClass="input" id="phoneNumber" size="10" maxlength="20" value="#{contactController.phoneNumber}">
- <f:validator for="phoneNumber" validatorId="PhoneNumberValidator" />
- </h:inputText>
- </div>
-
- <div class="clear"></div>
- </div>
-
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel for="faxNumber" value="#{msg.PERSONAL_DATA_FAX_NUMBER}" />
- </div>
-
- <div class="table_right">
- <h:selectOneMenu styleClass="select" id="faxCountryCode" value="#{contactController.faxCountry}" converter="CountryConverter">
- <f:selectItem itemValue="" itemLabel="#{msg.NONE_SELECTED}" />
- <f:selectItems value="#{countryController.allCountries()}" var="c" itemValue="#{c}" itemLabel="#{c.countryAbroadDialPrefix}#{c.countryPhoneCode}" />
- </h:selectOneMenu>
-
- <h:inputText styleClass="input" id="faxAreaCode" size="5" maxlength="10" value="#{contactController.faxAreaCode}">
- <f:validator for="faxAreaCode" validatorId="PhoneNumberValidator" />
- </h:inputText>
-
- <h:inputText styleClass="input" id="faxNumber" size="10" maxlength="20" value="#{contactController.faxNumber}">
- <f:validator for="faxNumber" validatorId="PhoneNumberValidator" />
- </h:inputText>
- </div>
-
- <div class="clear"></div>
- </div>
-
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel for="cellphoneNumber" value="#{msg.PERSONAL_DATA_CELLPHONE_NUMBER}" />
- </div>
-
- <div class="table_right">
- <ui:include src="/WEB-INF/templates/generic/mobile_selection_box.tpl">
- <ui:param name="targetController" value="#{contactController}" />
- </ui:include>
- </div>
-
- <div class="clear"></div>
- </div>
- </fieldset>
- </div>
-
- <div class="para">
- <fieldset id="user_profile">
- <legend title="#{msg.USER_PROFILE_LEGEND_TITLE}">#{msg.USER_PROFILE_LEGEND}</legend>
-
- <div class="table_row">
- <div class="table_left">
- <h:outputLabel for="profileMode" value="#{msg.USER_PROFILE_MODE}" />
- </div>
-
- <div class="table_right">
- <ui:include src="/WEB-INF/templates/generic/profile_mode_selection_box.tpl" />
- </div>
-
- <div class="clear"></div>
- </div>
-
- <div class="table_row">
- <div class="para notice">
- <ul>
- <li>#{msg.SELECTION_NOTICE_USER_PROFILE_MODE_INVISIBLE}</li>
- <li>#{msg.SELECTION_NOTICE_USER_PROFILE_MODE_MEMBERS}</li>
- <li>#{msg.SELECTION_NOTICE_USER_PROFILE_MODE_PUBLIC}</li>
- </ul>
- </div>
- </div>
- </fieldset>
- </div>
-</ui:composition>
#{msg.GUEST_REGISTRATION_TITLE}
</div>
- <ui:include src="/WEB-INF/templates/generic/form_personal_data.tpl" />
+ <ui:include src="/WEB-INF/templates/contact/form_contact_data.tpl" />
<div class="para">
<fieldset id="login_data">
<div class="table_row">
<div class="table_left">
- <h:outputLabel for="emailAddress1" value="#{msg.GUEST_REGISTRATION_ENTER_EMAIL1}" />
+ <h:outputLabel for="emailAddress" value="#{msg.GUEST_REGISTRATION_ENTER_EMAIL1}" />
</div>
<div class="table_right">
<div class="table_row">
<div class="table_left">
- <h:outputLabel for="emailAddress2" value="#{msg.GUEST_REGISTRATION_ENTER_EMAIL2}" />
+ <h:outputLabel for="emailAddressRepeat" value="#{msg.GUEST_REGISTRATION_ENTER_EMAIL2}" />
</div>
<div class="table_right">
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<ui:composition
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
+
+
+ <h:form id="register_form">
+ <div class="table">
+ <div class="table_header">
+ #{msg.GUEST_REGISTRATION_TITLE}
+ </div>
+
+ <ui:include src="/WEB-INF/templates/contact/form_contact_data.tpl" />
+
+ <div class="para">
+ <fieldset id="login_data">
+ <legend title="#{msg.GUEST_REGISTRATION_EMAIL_LEGEND_TITLE}">#{msg.GUEST_REGISTRATION_EMAIL_LEGEND}</legend>
+
+ <div class="table_row">
+ <div class="table_left">
+ <h:outputLabel for="userName" value="#{msg.GUEST_REGISTRATION_ENTER_USER_NAME}" />
+ </div>
+
+ <div class="table_right">
+ <h:inputText styleClass="input" id="userName" size="20" maxlength="255" value="#{userController.userName}" required="true" />
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="table_row">
+ <div class="table_left">
+ <h:outputLabel for="emailAddress" value="#{msg.GUEST_REGISTRATION_ENTER_EMAIL}" />
+ </div>
+
+ <div class="table_right">
+ <h:inputText styleClass="input" id="emailAddress" size="20" maxlength="255" value="#{contactController.emailAddress}" required="true" />
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="table_row">
+ <div class="table_left">
+ <h:outputLabel for="emailAddressRepeat" value="#{msg.GUEST_REGISTRATION_ENTER_EMAIL_REPEAT}" />
+ </div>
+
+ <div class="table_right">
+ <h:inputText styleClass="input" id="emailAddressRepeat" size="20" maxlength="255" value="#{contactController.emailAddressRepeat}" required="true" />
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="para"></div>
+
+ <div class="table_row">
+ <div class="table_left">
+ <h:outputLabel for="userPassword" value="#{msg.GUEST_REGISTRATION_ENTER_PASSWORD}" />
+ </div>
+
+ <div class="table_right">
+ <h:inputSecret styleClass="input" id="userPassword" size="10" maxlength="255" value="#{userController.userPassword}" required="true" />
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="table_row">
+ <div class="table_left">
+ <h:outputLabel for="userPasswordRepeat" value="#{msg.GUEST_REGISTRATION_ENTER_PASSWORD_REPEAT}" />
+ </div>
+
+ <div class="table_right">
+ <h:inputSecret styleClass="input" id="userPasswordRepeat" size="10" maxlength="255" value="#{userController.userPasswordRepeat}" required="true" />
+ </div>
+
+ <div class="clear"></div>
+ </div>
+
+ <div class="para notice">
+ #{msg.GUEST_REGISTRATION_USER_NAME_NOTICE}
+ </div>
+ </fieldset>
+ </div>
+
+ <ui:include src="/WEB-INF/templates/guest/guest_privacy_terms.tpl" />
+
+ <div class="table_footer">
+ <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+ <h:commandButton styleClass="submit" type="submit" id="register" value="#{msg.BUTTON_FINISH_REGISTRATION}" action="#{registerController.doRegister()}" />
+ </div>
+ </div>
+ </h:form>
+</ui:composition>
<html
lang="#{localizationController.language}" xml:lang="#{localizationController.language}"
xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
- xmlns:h="http://xmlns.jcp.org/jsf/html"
- xmlns:f="http://xmlns.jcp.org/jsf/core"
- >
+ xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
+ xmlns:h="http://xmlns.jcp.org/jsf/html"
+ xmlns:f="http://xmlns.jcp.org/jsf/core"
+ >
- <ui:composition template="/WEB-INF/templates/login/user/user_base.tpl">
+ <ui:composition template="/WEB-INF/templates/login/login_base.tpl">
<ui:define name="login_title">#{msg.PAGE_TITLE_LOGIN_CHANGE_EMAIL_ADDRESS}</ui:define>
<ui:define name="content_header">
</div>
<div class="table_right">
- #{contactController.emailAddress}
+ #{userController.emailAddress}
</div>
<div class="clear"></div>
</div>
<div class="table_right">
- <h:inputText styleClass="input" id="emailAddress" size="20" maxlength="255" value="#{emailChangeController.emailAddress}" required="true" />
+ <h:inputText class="input" id="emailAddress" size="20" maxlength="255" value="#{emailChangeController.emailAddress}" required="true" />
</div>
<div class="clear"></div>
</div>
<div class="table_right">
- <h:inputText styleClass="input" id="emailAddressRepeat" size="20" maxlength="255" value="#{emailChangeController.emailAddressRepeat}" required="true" />
+ <h:inputText class="input" id="emailAddressRepeat" size="20" maxlength="255" value="#{emailChangeController.emailAddressRepeat}" required="true" />
</div>
<div class="clear"></div>
</fieldset>
</div>
- <ui:include src="/WEB-INF/templates/login/user/user_enter_current_password.tpl" />
+ <ui:include src="/WEB-INF/templates/login/login_enter_current_password.tpl" />
<div class="table_footer">
- <h:commandButton styleClass="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
- <h:commandButton styleClass="submit" type="submit" id="change_email" value="#{msg.BUTTON_CHANGE_EMAIL_ADDRESS}" action="#{emailChangeController.doChangeEmailAddress()}" />
+ <h:commandButton class="reset" type="reset" value="#{msg.BUTTON_RESET_FORM}" />
+ <h:commandButton class="submit" type="submit" id="change_email" value="#{msg.BUTTON_CHANGE_EMAIL_ADDRESS}" action="#{emailChangeController.doChangeEmailAddress()}" />
</div>
</h:form>
</div>
</ui:fragment>
- <ui:fragment rendered="#{not userLoginController.isUserLoggedIn()}">
- <ui:include src="/WEB-INF/templates/user/user_not_logged_in.tpl" />
+ <ui:fragment rendered="#{not loginController.isUserLoggedIn()}">
+ <ui:include id="login_only" src="/WEB-INF/templates/generic/user_not_logged_in.tpl" />
</ui:fragment>
</ui:define>
</ui:composition>