From 195c605d1efa0fdb1d9692c3b5570c57e31f37cd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 19 May 2016 13:42:54 +0200 Subject: [PATCH] Continued: - renamed adminHelper to beanHelp as this is a really generic bean helper - renames same class/interface, too - added JSF page for confirming accounts with optional parameter confirmKey. If this is not set, a message will be shown - added i18n keys for above new page - added controller bean for above page to handle the confirmation + calling proper EJB business method MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../localization/bundle_de_DE.properties | 7 + .../localization/bundle_en_US.properties | 7 + .../PizzaConfirmationLinkWebRequestBean.java | 198 +++++++++ ...aConfirmationLinkWebRequestController.java | 50 +++ .../PizzaAdminContactWebRequestBean.java | 12 +- .../PizzaAdminCustomerWebRequestBean.java | 4 +- ...er.java => PizzaWebRequestController.java} | 2 +- ...Helper.java => PizzaWebRequestHelper.java} | 8 +- .../user/PizzaAdminUserWebRequestBean.java | 46 +-- .../admin/contact/admin_contact_data.tpl | 214 +++++----- .../register/guest_form_register_page2.tpl | 22 + .../register/guest_form_register_single.tpl | 2 +- web/admin/contact/admin_contact_delete.xhtml | 12 +- web/admin/contact/admin_contact_edit.xhtml | 12 +- web/admin/contact/admin_contact_list.xhtml | 4 +- web/admin/contact/admin_contact_show.xhtml | 84 ++-- web/admin/country/admin_country_list.xhtml | 4 +- .../admin_mobile_provider_list.xhtml | 4 +- web/admin/user/admin_user_delete.xhtml | 58 +-- web/admin/user/admin_user_edit.xhtml | 10 +- web/admin/user/admin_user_list.xhtml | 4 +- web/admin/user/admin_user_show.xhtml | 378 +++++++++--------- web/admin/user/admin_user_unlock.xhtml | 58 +-- web/customer/empty_basket.xhtml | 4 +- web/guest/user/confirm_account.xhtml | 51 +++ 25 files changed, 787 insertions(+), 468 deletions(-) create mode 100644 src/java/org/mxchange/pizzaapplication/beans/confirmlink/PizzaConfirmationLinkWebRequestBean.java create mode 100644 src/java/org/mxchange/pizzaapplication/beans/confirmlink/PizzaConfirmationLinkWebRequestController.java rename src/java/org/mxchange/pizzaapplication/beans/helper/{PizzaAdminWebRequestController.java => PizzaWebRequestController.java} (97%) rename src/java/org/mxchange/pizzaapplication/beans/helper/{PizzaAdminWebRequestHelper.java => PizzaWebRequestHelper.java} (97%) create mode 100644 web/WEB-INF/templates/guest/user/register/guest_form_register_page2.tpl create mode 100644 web/guest/user/confirm_account.xhtml diff --git a/src/java/org/mxchange/localization/bundle_de_DE.properties b/src/java/org/mxchange/localization/bundle_de_DE.properties index ab68dd94..d6663b12 100644 --- a/src/java/org/mxchange/localization/bundle_de_DE.properties +++ b/src/java/org/mxchange/localization/bundle_de_DE.properties @@ -502,3 +502,10 @@ GUEST_RESEND_LINK_ENTER_EMAIL_ADDRESS=Bitte bei der Anmeldung verwendete Email-A GUEST_RESEND_CONFIRMATION_LINK_NOTICE=Der alte Best\u00e4tigungslink wird hiernach verfallen, bitte dann den aus der neueren Mail verwenden. RESEND_CONFIRMATION_LINK_LEGEND=Email-Adresse eingeben: RESEND_CONFIRMATION_LINK_LEGEND_TITLE=Bitte geben Sie Ihre Email-Adresse ein, die Sie bei der Anmeldung verwendet haben. +PAGE_TITLE_INDEX_CONFIRM_ACCOUNT=Anmeldung best\u00e4tigen +CONTENT_TITLE_INDEX_CONFIRM_ACCOUNT=Benutzeranmeldung best\u00e4tigen: +GUEST_CONFIRMATION_LINK_INVALID=Best\u00e4tigungslink nicht mehr g\u00fcltig. Bitte lassen Sie sich einen neuen Link zusenden oder wenden Sie sich an den Support. +GUEST_CONFIRMATION_KEY_NOT_SET=Es wurde keine Best\u00e4tigungsschl\u00fcssel angegeben. Bitte pr\u00fcfen Sie den Link aus der Mail. +GUEST_CONFIRM_USER_ACCOUNT_DONE_TITLE=Vielen Dank f\u00fcr die Best\u00e4tigung +GUEST_USER_CONFIRM_ACCOUNT_DONE=Hallo {0} {1} {2}. Sie haben soeben Ihren Account best\u00e4tigt. Es ist eine Mail mit weiteren Details an Sie unterwegs. +BUTTON_GUEST_CONFIRM_USER_ACCOUNT=Account best\u00e4tigen diff --git a/src/java/org/mxchange/localization/bundle_en_US.properties b/src/java/org/mxchange/localization/bundle_en_US.properties index edcecd1a..e6a57d21 100644 --- a/src/java/org/mxchange/localization/bundle_en_US.properties +++ b/src/java/org/mxchange/localization/bundle_en_US.properties @@ -486,3 +486,10 @@ LOGIN_CHANGE_PERSONAL_DATA_TITLE=Change personal data: LINK_LOGIN_CHANGE_PASSWORD_TITLE=Change here your password, if you want another one. LINK_LOGIN_CHANGE_EMAIL_ADDRESS=Change your email address LINK_TITLE_GUEST_LOGIN_LOST_PASSWORD=Restore your password +PAGE_TITLE_INDEX_CONFIRM_ACCOUNT=Confirm registration +CONTENT_TITLE_INDEX_CONFIRM_ACCOUNT=Confirm user registration: +GUEST_CONFIRMATION_LINK_INVALID=Confirmation link is no longer valid. Please try to send a new link to your email address or contact support. +GUEST_CONFIRMATION_KEY_NOT_SET=No confirmation key was provided. Please check the link from the mail. +GUEST_CONFIRM_USER_ACCOUNT_DONE_TITLE=Thank you for confirmation of your account +GUEST_USER_CONFIRM_ACCOUNT_DONE=Hello {0} {1} {2}. You have successfully confirmed your account. An email with more details is on it's way to you. +BUTTON_GUEST_CONFIRM_USER_ACCOUNT=Confirm account diff --git a/src/java/org/mxchange/pizzaapplication/beans/confirmlink/PizzaConfirmationLinkWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/confirmlink/PizzaConfirmationLinkWebRequestBean.java new file mode 100644 index 00000000..3a21f72c --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/confirmlink/PizzaConfirmationLinkWebRequestBean.java @@ -0,0 +1,198 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.confirmlink; + +import java.text.MessageFormat; +import java.util.Iterator; +import java.util.List; +import java.util.Objects; +import javax.enterprise.context.RequestScoped; +import javax.faces.view.facelets.FaceletException; +import javax.inject.Inject; +import javax.inject.Named; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import org.mxchange.jcoreee.utils.FacesUtils; +import org.mxchange.jusercore.exceptions.UserStatusConfirmedException; +import org.mxchange.jusercore.exceptions.UserStatusLockedException; +import org.mxchange.jusercore.model.user.User; +import org.mxchange.jusercore.model.user.UserSessionBeanRemote; +import org.mxchange.jusercore.model.user.status.UserAccountStatus; +import org.mxchange.pizzaapplication.beans.BasePizzaController; +import org.mxchange.pizzaapplication.beans.helper.PizzaWebRequestController; +import org.mxchange.pizzaapplication.beans.user.PizzaUserWebSessionController; + +/** + * A web request bean for confirmation link handling + *

+ * @author Roland Haeder + */ +@Named ("confirmationLinkController") +@RequestScoped +public class PizzaConfirmationLinkWebRequestBean extends BasePizzaController implements PizzaConfirmationLinkWebRequestController { + + /** + * Serial number + */ + private static final long serialVersionUID = 57_637_182_796_370L; + + /** + * Admin helper instance + */ + @Inject + private PizzaWebRequestController beanHelper; + + /** + * Confirmation key + */ + private String confirmationKey; + + /** + * Remote user bean + */ + private final UserSessionBeanRemote userBean; + + /** + * User controller + */ + @Inject + private PizzaUserWebSessionController userController; + + /** + * Default constructor + */ + public PizzaConfirmationLinkWebRequestBean () { + // Try it + try { + // Get initial context + Context context = new InitialContext(); + + // Try to lookup + this.userBean = (UserSessionBeanRemote) context.lookup("java:global/jlandingpage-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N + } catch (final NamingException e) { + // Throw again + throw new FaceletException(e); + } + } + + @Override + public String getConfirmationKey () { + return this.confirmationKey; + } + + @Override + public void setConfirmationKey (final String confirmationKey) { + this.confirmationKey = confirmationKey; + } + + @Override + public void maybeConfirmUserAccount () { + // Is the confirmation key set? + if (this.getConfirmationKey() == null) { + // May be null if not set + return; + } else if (this.getConfirmationKey().isEmpty()) { + // Is empty string + return; + } + + // Now try to find the user in user list, first get the whole list + List users = this.userController.allUsers(); + + // Get iterator from it + Iterator iterator = users.iterator(); + + // Init instance + User user = null; + + // Then loop through all + while (iterator.hasNext()) { + // Get next user + User next = iterator.next(); + + // Same confirmation key? + if (Objects.equals(this.getConfirmationKey(), next.getUserConfirmKey())) { + // Found it, then set it and abort loop + user = next; + break; + } + } + + // Is the user instance null? + if ((null == user) || (user.getUserAccountStatus() != UserAccountStatus.UNCONFIRMED)) { + // Then clear this bean and the helper + this.beanHelper.setUser(null); + } else { + // Set user ... + this.beanHelper.setUser(user); + + // ... and copy it to the controller + this.beanHelper.copyUserToController(); + + // Try to confirm it + this.confirmUserAccount(); + } + } + + /** + * Tries to confirm the currently set user instance (in helper). + */ + private void confirmUserAccount () { + // Get user instance + User user = this.beanHelper.getUser(); + + // Should be set + if (null == user) { + // Throw NPE + throw new NullPointerException("user is null"); + } else if (user.getUserId() == null) { + // Abort here + throw new NullPointerException("user.userId is null"); //NOI18N + } else if (user.getUserId() < 1) { + // Invalid number + throw new IllegalArgumentException(MessageFormat.format("userId is not valid: {0}", user.getUserId())); //NOI18N + } else if (user.getUserAccountStatus() == UserAccountStatus.CONFIRMED) { + // Account is already confirmed + throw new FaceletException(new UserStatusConfirmedException(user)); + } else if (user.getUserAccountStatus() == UserAccountStatus.LOCKED) { + // Account is already confirmed + throw new FaceletException(new UserStatusLockedException(user)); + } else if (user.getUserConfirmKey() == null) { + // Throw NPE + throw new NullPointerException("user.userConfirmKey is null"); //NOI18N + } + + // Updated user instance + User updatedUser; + + try { + // Get base URL + String baseUrl = FacesUtils.generateBaseUrl(); + + // Confirm account + updatedUser = this.userBean.confirmAccount(user, baseUrl); + } catch (final UserStatusConfirmedException | UserStatusLockedException ex) { + // Something unexpected happened + throw new FaceletException(MessageFormat.format("Cannot confirm user account {0}", user.getUserName()), ex); //NOI18N + } + + // Set it again in helper + this.beanHelper.setUser(updatedUser); + } + +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/confirmlink/PizzaConfirmationLinkWebRequestController.java b/src/java/org/mxchange/pizzaapplication/beans/confirmlink/PizzaConfirmationLinkWebRequestController.java new file mode 100644 index 00000000..38d4c901 --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/beans/confirmlink/PizzaConfirmationLinkWebRequestController.java @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ +package org.mxchange.pizzaapplication.beans.confirmlink; + +import java.io.Serializable; + +/** + * An interface for an email change controller + *

+ * @author Roland Haeder + */ +public interface PizzaConfirmationLinkWebRequestController extends Serializable { + + /** + * Getter for confirmation key + *

+ * @return Confirmation key + */ + String getConfirmationKey (); + + /** + * Setter for confirmation key + *

+ * @param confirmationKey Confirmation key + */ + void setConfirmationKey (final String confirmationKey); + + /** + * Tries to lookup the user by currently set confirmation key and if found + * tries to confirm it. If no user is found, the instance beanHelper.user is + * set to null. Other methods or JSF pages should then respond on this + * accordingly. + */ + void maybeConfirmUserAccount (); + +} diff --git a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java index 19224194..001a6157 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/contact/PizzaAdminContactWebRequestBean.java @@ -48,7 +48,7 @@ import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jphone.phonenumbers.landline.LandLineNumber; import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider; import org.mxchange.pizzaapplication.beans.BasePizzaController; -import org.mxchange.pizzaapplication.beans.helper.PizzaAdminWebRequestController; +import org.mxchange.pizzaapplication.beans.helper.PizzaWebRequestController; /** * Administrative user bean (controller) @@ -75,7 +75,7 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme * Admin helper instance */ @Inject - private PizzaAdminWebRequestController adminHelper; + private PizzaWebRequestController beanHelper; /** * Birth day @@ -442,18 +442,18 @@ public class PizzaAdminContactWebRequestBean extends BasePizzaController impleme @Override public String editContactData () { // Get contact instance - Contact contact = this.adminHelper.getContact(); + Contact contact = this.beanHelper.getContact(); // Check if contact instance is in helper and valid if (null == contact) { // Throw NPE - throw new NullPointerException("adminHelper.contact is null"); //NOI18N + throw new NullPointerException("beanHelper.contact is null"); //NOI18N } else if (contact.getContactId() == null) { // Throw NPE again - throw new NullPointerException("adminHelper.contact.contactId is null"); //NOI18N //NOI18N + throw new NullPointerException("beanHelper.contact.contactId is null"); //NOI18N //NOI18N } else if (contact.getContactId() < 1) { // Invalid id - throw new IllegalStateException(MessageFormat.format("adminHelper.contact.contactId={0} is invalid", contact.getContactId())); //NOI18N + throw new IllegalStateException(MessageFormat.format("beanHelper.contact.contactId={0} is invalid", contact.getContactId())); //NOI18N } // Update all data in contact diff --git a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java index 3a11d7dd..0c16549d 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/customer/PizzaAdminCustomerWebRequestBean.java @@ -37,9 +37,9 @@ import org.mxchange.jcustomercore.model.customer.Customer; import org.mxchange.jcustomercore.model.customer.status.CustomerAccountStatus; import org.mxchange.pizzaapplication.beans.BasePizzaController; import org.mxchange.pizzaapplication.beans.contact.PizzaAdminContactWebRequestController; -import org.mxchange.pizzaapplication.beans.helper.PizzaAdminWebRequestController; import org.mxchange.pizzaapplication.model.customer.PizzaAdminCustomerSessionBeanRemote; import org.mxchange.pizzaapplication.model.customer.PizzaCustomer; +import org.mxchange.pizzaapplication.beans.helper.PizzaWebRequestController; /** * Administrative customer bean (controller) @@ -70,7 +70,7 @@ public class PizzaAdminCustomerWebRequestBean extends BasePizzaController implem * Admin helper instance */ @Inject - private PizzaAdminWebRequestController adminHelper; + private PizzaWebRequestController adminHelper; /** * An event being fired when an administrator has added a new customer diff --git a/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaAdminWebRequestController.java b/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaWebRequestController.java similarity index 97% rename from src/java/org/mxchange/pizzaapplication/beans/helper/PizzaAdminWebRequestController.java rename to src/java/org/mxchange/pizzaapplication/beans/helper/PizzaWebRequestController.java index 097daf11..ebd963bc 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaAdminWebRequestController.java +++ b/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaWebRequestController.java @@ -26,7 +26,7 @@ import org.mxchange.jusercore.model.user.User; *

* @author Roland Haeder */ -public interface PizzaAdminWebRequestController extends Serializable { +public interface PizzaWebRequestController extends Serializable { /** * Getter for user instance diff --git a/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaAdminWebRequestHelper.java b/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaWebRequestHelper.java similarity index 97% rename from src/java/org/mxchange/pizzaapplication/beans/helper/PizzaAdminWebRequestHelper.java rename to src/java/org/mxchange/pizzaapplication/beans/helper/PizzaWebRequestHelper.java index f06c3c53..9873bbac 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaAdminWebRequestHelper.java +++ b/src/java/org/mxchange/pizzaapplication/beans/helper/PizzaWebRequestHelper.java @@ -29,13 +29,13 @@ import org.mxchange.pizzaapplication.beans.customer.PizzaCustomerWebSessionContr import org.mxchange.pizzaapplication.beans.user.PizzaUserWebSessionController; /** - * A general helper for administrative beans + * A general helper for beans *

* @author Roland Haeder */ -@Named ("adminHelper") +@Named ("beanHelper") @RequestScoped -public class PizzaAdminWebRequestHelper implements PizzaAdminWebRequestController { +public class PizzaWebRequestHelper implements PizzaWebRequestController { /** * Serial number @@ -84,7 +84,7 @@ public class PizzaAdminWebRequestHelper implements PizzaAdminWebRequestControlle /** * Default constructor */ - public PizzaAdminWebRequestHelper () { + public PizzaWebRequestHelper () { } @Override diff --git a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java index 1b436a2e..5eb50833 100644 --- a/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/pizzaapplication/beans/user/PizzaAdminUserWebRequestBean.java @@ -16,7 +16,6 @@ */ package org.mxchange.pizzaapplication.beans.user; -import org.mxchange.pizzaapplication.beans.BasePizzaController; import java.text.MessageFormat; import java.util.Objects; import javax.annotation.PostConstruct; @@ -31,7 +30,6 @@ import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import org.mxchange.jcontacts.contact.Contact; -import org.mxchange.jcontacts.contact.ContactSessionBeanRemote; import org.mxchange.jusercore.container.login.UserLoginContainer; import org.mxchange.jusercore.events.registration.UserRegisteredEvent; import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent; @@ -47,9 +45,9 @@ import org.mxchange.jusercore.model.user.UserSessionBeanRemote; import org.mxchange.jusercore.model.user.UserUtils; import org.mxchange.jusercore.model.user.profilemodes.ProfileMode; import org.mxchange.jusercore.model.user.status.UserAccountStatus; +import org.mxchange.pizzaapplication.beans.BasePizzaController; import org.mxchange.pizzaapplication.beans.contact.PizzaContactWebSessionController; -import org.mxchange.pizzaapplication.beans.helper.PizzaAdminWebRequestController; -import org.mxchange.pizzaapplication.beans.login.PizzaUserLoginWebSessionController; +import org.mxchange.pizzaapplication.beans.helper.PizzaWebRequestController; /** * Administrative user bean (controller) @@ -73,15 +71,10 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements private Event addedUserEvent; /** - * Admin helper instance + * Bean helper instance */ @Inject - private PizzaAdminWebRequestController adminHelper; - - /** - * Remote user bean - */ - private final ContactSessionBeanRemote contactBean; + private PizzaWebRequestController beanHelper; /** * Regular contact controller @@ -107,12 +100,6 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements @Inject private PizzaUserWebSessionController userController; - /** - * Login bean (controller) - */ - @Inject - private PizzaUserLoginWebSessionController userLoginController; - /** * User name */ @@ -139,9 +126,6 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements // Try to lookup this.userBean = (UserSessionBeanRemote) context.lookup("java:global/pizzaservice-ejb/user!org.mxchange.jusercore.model.user.UserSessionBeanRemote"); //NOI18N - - // Try to lookup - this.contactBean = (ContactSessionBeanRemote) context.lookup("java:global/pizzaservice-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N } catch (final NamingException e) { // Throw again throw new FaceletException(e); @@ -160,7 +144,7 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements } else if (this.getUserName().isEmpty()) { // Is empty throw new IllegalArgumentException("userName is null"); //NOI18N - } else if (this.adminHelper.getContact() == null) { + } else if (this.beanHelper.getContact() == null) { // No contact instance set, so test required fields: gender, first name and family name if (this.contactController.getGender() == null) { // Throw NPE again @@ -204,9 +188,9 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements Contact contact; // Is a contact instance in helper set? - if (this.adminHelper.getContact() instanceof Contact) { + if (this.beanHelper.getContact() instanceof Contact) { // Then use it for contact linking - contact = this.adminHelper.getContact(); + contact = this.beanHelper.getContact(); } else { // Create contact instance contact = this.contactController.createContactInstance(); @@ -223,7 +207,7 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements if (this.userController.isUserNameRegistered(user)) { // User name is already used throw new FaceletException(new UserNameAlreadyRegisteredException(user)); - } else if ((this.adminHelper.getContact() == null) && (this.contactController.isEmailAddressRegistered(user.getUserContact()))) { + } else if ((this.beanHelper.getContact() == null) && (this.contactController.isEmailAddressRegistered(user.getUserContact()))) { // Email address is already used throw new FaceletException(new EmailAddressAlreadyRegisteredException(user)); } else if ((this.getUserPassword() == null && (this.getUserPasswordRepeat() == null)) || ((this.getUserPassword().isEmpty()) && (this.getUserPasswordRepeat().isEmpty()))) { @@ -249,12 +233,12 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements try { // Now, that all is set, call EJB - if (this.adminHelper.getContact() instanceof Contact) { + if (this.beanHelper.getContact() instanceof Contact) { // Link contact with this user updatedUser = this.userBean.linkUser(user); // Remove contact instance - this.adminHelper.setContact(null); + this.beanHelper.setContact(null); } else { // Add new contact updatedUser = this.userBean.addUser(user); @@ -265,7 +249,7 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements } // Clear helper - this.adminHelper.setContact(null); + this.beanHelper.setContact(null); // Fire event this.addedUserEvent.fire(new AdminUserAddedEvent(updatedUser)); @@ -313,7 +297,7 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements @Override public String editUserData () { // Get user instance - User user = this.adminHelper.getUser(); + User user = this.beanHelper.getUser(); // Null password means not setting it String encryptedPassword = null; @@ -321,13 +305,13 @@ public class PizzaAdminUserWebRequestBean extends BasePizzaController implements // Check if user instance is in helper and valid if (null == user) { // Throw NPE - throw new NullPointerException("adminHelper.user is null"); //NOI18N + throw new NullPointerException("beanHelper.user is null"); //NOI18N } else if (user.getUserId() == null) { // Throw NPE again - throw new NullPointerException("adminHelper.user.userId is null"); //NOI18N //NOI18N + throw new NullPointerException("beanHelper.user.userId is null"); //NOI18N //NOI18N } else if (user.getUserId() < 1) { // Invalid id - throw new IllegalStateException(MessageFormat.format("adminHelper.user.userId={0} is invalid", user.getUserId())); //NOI18N //NOI18N + throw new IllegalStateException(MessageFormat.format("beanHelper.user.userId={0} is invalid", user.getUserId())); //NOI18N //NOI18N } else if (this.getUserName() == null) { // Not all required fields are set throw new NullPointerException("this.userName is null"); //NOI18N diff --git a/web/WEB-INF/templates/admin/contact/admin_contact_data.tpl b/web/WEB-INF/templates/admin/contact/admin_contact_data.tpl index 799a19b6..5e29f6f6 100644 --- a/web/WEB-INF/templates/admin/contact/admin_contact_data.tpl +++ b/web/WEB-INF/templates/admin/contact/admin_contact_data.tpl @@ -1,107 +1,107 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/WEB-INF/templates/guest/user/register/guest_form_register_page2.tpl b/web/WEB-INF/templates/guest/user/register/guest_form_register_page2.tpl new file mode 100644 index 00000000..1e7e0a89 --- /dev/null +++ b/web/WEB-INF/templates/guest/user/register/guest_form_register_page2.tpl @@ -0,0 +1,22 @@ + + + + +

+
+ #{msg.GUEST_REGISTRATION_PAGE2_TITLE} +
+ + + + +
+ + diff --git a/web/WEB-INF/templates/guest/user/register/guest_form_register_single.tpl b/web/WEB-INF/templates/guest/user/register/guest_form_register_single.tpl index 043babe7..df3087a7 100644 --- a/web/WEB-INF/templates/guest/user/register/guest_form_register_single.tpl +++ b/web/WEB-INF/templates/guest/user/register/guest_form_register_single.tpl @@ -71,7 +71,7 @@ diff --git a/web/admin/contact/admin_contact_delete.xhtml b/web/admin/contact/admin_contact_delete.xhtml index badc92e3..a3ae28a0 100644 --- a/web/admin/contact/admin_contact_delete.xhtml +++ b/web/admin/contact/admin_contact_delete.xhtml @@ -9,8 +9,8 @@ > - - + + @@ -21,13 +21,13 @@ - + - +
- +
@@ -39,7 +39,7 @@
diff --git a/web/admin/contact/admin_contact_edit.xhtml b/web/admin/contact/admin_contact_edit.xhtml index 0ac502ad..bd123b61 100644 --- a/web/admin/contact/admin_contact_edit.xhtml +++ b/web/admin/contact/admin_contact_edit.xhtml @@ -9,8 +9,8 @@ > - - + + @@ -21,13 +21,13 @@
- + - +
- +
@@ -41,7 +41,7 @@
diff --git a/web/admin/contact/admin_contact_list.xhtml b/web/admin/contact/admin_contact_list.xhtml index a139d35f..66ac4199 100644 --- a/web/admin/contact/admin_contact_list.xhtml +++ b/web/admin/contact/admin_contact_list.xhtml @@ -46,7 +46,7 @@ #{msg.ADMIN_CONTACT_USAGE} - + @@ -72,7 +72,7 @@
diff --git a/web/admin/contact/admin_contact_show.xhtml b/web/admin/contact/admin_contact_show.xhtml index fccf2ebc..28131f20 100644 --- a/web/admin/contact/admin_contact_show.xhtml +++ b/web/admin/contact/admin_contact_show.xhtml @@ -1,42 +1,42 @@ - - - - - - - - - - - #{msg.PAGE_TITLE_ADMIN_SHOW_CONTACT} - - - #{msg.CONTENT_TITLE_ADMIN_SHOW_CONTACT} - - - - - - - -
- - - -
- -
- - - - -
-
-
- + + + + + + + + + + + #{msg.PAGE_TITLE_ADMIN_SHOW_CONTACT} + + + #{msg.CONTENT_TITLE_ADMIN_SHOW_CONTACT} + + + + + + + +
+ + + +
+ +
+ + + + +
+
+
+ diff --git a/web/admin/country/admin_country_list.xhtml b/web/admin/country/admin_country_list.xhtml index 2d172240..73737268 100644 --- a/web/admin/country/admin_country_list.xhtml +++ b/web/admin/country/admin_country_list.xhtml @@ -44,7 +44,7 @@ - +
#{msg.ADMIN_ADD_COUNTRY_TITLE} @@ -54,7 +54,7 @@
diff --git a/web/admin/mobile_provider/admin_mobile_provider_list.xhtml b/web/admin/mobile_provider/admin_mobile_provider_list.xhtml index bf450a76..ebb50f94 100644 --- a/web/admin/mobile_provider/admin_mobile_provider_list.xhtml +++ b/web/admin/mobile_provider/admin_mobile_provider_list.xhtml @@ -52,7 +52,7 @@ - +
#{msg.ADMIN_ADD_MOBILE_PROVIDER_TITLE} @@ -62,7 +62,7 @@
diff --git a/web/admin/user/admin_user_delete.xhtml b/web/admin/user/admin_user_delete.xhtml index 720c9033..bc0f33aa 100644 --- a/web/admin/user/admin_user_delete.xhtml +++ b/web/admin/user/admin_user_delete.xhtml @@ -1,29 +1,29 @@ - - - - - - - - - - - #{msg.PAGE_TITLE_ADMIN_DELETE_USER} - - - #{msg.CONTENT_TITLE_ADMIN_DELETE_USER} - - - - - - Here goes your content. - - - + + + + + + + + + + + #{msg.PAGE_TITLE_ADMIN_DELETE_USER} + + + #{msg.CONTENT_TITLE_ADMIN_DELETE_USER} + + + + + + Here goes your content. + + + diff --git a/web/admin/user/admin_user_edit.xhtml b/web/admin/user/admin_user_edit.xhtml index e20902b9..c244d081 100644 --- a/web/admin/user/admin_user_edit.xhtml +++ b/web/admin/user/admin_user_edit.xhtml @@ -8,8 +8,8 @@ > - - + + @@ -20,9 +20,9 @@ - + - +
#{msg.ADMIN_EDIT_USER_TITLE} @@ -38,7 +38,7 @@
diff --git a/web/admin/user/admin_user_list.xhtml b/web/admin/user/admin_user_list.xhtml index dd8645a2..f8280a2b 100644 --- a/web/admin/user/admin_user_list.xhtml +++ b/web/admin/user/admin_user_list.xhtml @@ -86,7 +86,7 @@
- + @@ -105,7 +105,7 @@
diff --git a/web/admin/user/admin_user_show.xhtml b/web/admin/user/admin_user_show.xhtml index 927dfc9b..3eb471cb 100644 --- a/web/admin/user/admin_user_show.xhtml +++ b/web/admin/user/admin_user_show.xhtml @@ -1,189 +1,189 @@ - - - - - - - - - - - #{msg.PAGE_TITLE_ADMIN_SHOW_USER} - - - #{msg.CONTENT_TITLE_ADMIN_SHOW_USER} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- -
- - - - -
-
-
- + + + + + + + + + + + #{msg.PAGE_TITLE_ADMIN_SHOW_USER} + + + #{msg.CONTENT_TITLE_ADMIN_SHOW_USER} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ +
+ + + + +
+
+
+ diff --git a/web/admin/user/admin_user_unlock.xhtml b/web/admin/user/admin_user_unlock.xhtml index 7b33fdaa..f5df7f75 100644 --- a/web/admin/user/admin_user_unlock.xhtml +++ b/web/admin/user/admin_user_unlock.xhtml @@ -1,29 +1,29 @@ - - - - - - - - - - - #{msg.PAGE_TITLE_ADMIN_UNLOCK_USER} - - - #{msg.CONTENT_TITLE_ADMIN_UNLOCK_USER} - - - - - - Here goes your content. - - - + + + + + + + + + + + #{msg.PAGE_TITLE_ADMIN_UNLOCK_USER} + + + #{msg.CONTENT_TITLE_ADMIN_UNLOCK_USER} + + + + + + Here goes your content. + + + diff --git a/web/customer/empty_basket.xhtml b/web/customer/empty_basket.xhtml index a27aae9c..3beb00ec 100644 --- a/web/customer/empty_basket.xhtml +++ b/web/customer/empty_basket.xhtml @@ -17,7 +17,7 @@ - +
@@ -49,7 +49,7 @@
diff --git a/web/guest/user/confirm_account.xhtml b/web/guest/user/confirm_account.xhtml new file mode 100644 index 00000000..8b6a4571 --- /dev/null +++ b/web/guest/user/confirm_account.xhtml @@ -0,0 +1,51 @@ + + + + + + + + + + + #{msg.PAGE_TITLE_INDEX_CONFIRM_ACCOUNT} + + + #{msg.CONTENT_TITLE_INDEX_CONFIRM_ACCOUNT} + + + + + +
+
+ +
+ +
+ + + + + +
+
+
+ + + + +
+ + + + +
+
+ -- 2.39.5