From 430a1c3abf874325fabd2d7b5042e682f5626f12 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Wed, 20 Apr 2016 19:42:19 +0200 Subject: [PATCH] Injected contact controller as now stuff around contacts are done there, not in user. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../JobsUserRegisterWebSessionBean.java | 13 ++++++++++--- .../JobsUserRegisterWebSessionController.java | 1 + .../user/JobsAdminUserWebRequestBean.java | 18 ++++++------------ 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/java/org/mxchange/jjobs/beans/register/JobsUserRegisterWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/register/JobsUserRegisterWebSessionBean.java index 16290bbc..dca9fc6c 100644 --- a/src/java/org/mxchange/jjobs/beans/register/JobsUserRegisterWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/register/JobsUserRegisterWebSessionBean.java @@ -26,6 +26,7 @@ import javax.inject.Named; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; +import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController; import org.mxchange.jjobs.beans.user.JobsUserWebSessionController; import org.mxchange.jusercore.events.registration.RegisteredUserEvent; import org.mxchange.jusercore.events.registration.UserRegisteredEvent; @@ -51,6 +52,12 @@ public class JobsUserRegisterWebSessionBean implements JobsUserRegisterWebSessio */ private static final long serialVersionUID = 47_828_986_719_691_592L; + /** + * User controller + */ + @Inject + private JobsContactWebSessionController contactController; + /** * Reemote register session bean */ @@ -100,12 +107,12 @@ public class JobsUserRegisterWebSessionBean implements JobsUserRegisterWebSessio } else if (this.userController.isUserNameRegistered(user)) { // User name is already used throw new FaceletException(new UserNameAlreadyRegisteredException(user)); - } else if (this.userController.isEmailAddressRegistered(user)) { + } else if (this.contactController.isEmailAddressRegistered(user.getUserContact())) { // Email address has already been taken throw new FaceletException(new EmailAddressAlreadyRegisteredException(user)); - } else if (!this.userController.isSameEmailAddressEntered()) { + } else if (!this.contactController.isSameEmailAddressEntered()) { // Not same email address entered - throw new FaceletException(new DataRepeatMismatchException(MessageFormat.format("Email addresses not matching: {0} != {1}", this.userController.getEmailAddress(), this.userController.getEmailAddressRepeat()))); //NOI18N + throw new FaceletException(new DataRepeatMismatchException(MessageFormat.format("Email addresses not matching: {0} != {1}", this.contactController.getEmailAddress(), this.contactController.getEmailAddressRepeat()))); //NOI18N } else if (!this.userController.isSamePasswordEntered()) { // Not same password entered throw new FaceletException(new DataRepeatMismatchException("Passwords not matching.")); //NOI18N diff --git a/src/java/org/mxchange/jjobs/beans/register/JobsUserRegisterWebSessionController.java b/src/java/org/mxchange/jjobs/beans/register/JobsUserRegisterWebSessionController.java index e414b7d2..209999b1 100644 --- a/src/java/org/mxchange/jjobs/beans/register/JobsUserRegisterWebSessionController.java +++ b/src/java/org/mxchange/jjobs/beans/register/JobsUserRegisterWebSessionController.java @@ -32,4 +32,5 @@ public interface JobsUserRegisterWebSessionController extends Serializable { * @return Redirection target */ String doRegister (); + } diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java index 73526fee..b58623e1 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java @@ -78,6 +78,12 @@ public class JobsAdminUserWebRequestBean implements JobsAdminUserWebRequestContr */ private final UserSessionBeanRemote userBean; + /** + * Regular user controller + */ + @Inject + private JobsUserWebSessionController userController; + /** * A list of all user profiles */ @@ -98,18 +104,6 @@ public class JobsAdminUserWebRequestBean implements JobsAdminUserWebRequestContr */ private String userPasswordRepeat; - /** -<<<<<<< HEAD:src/java/org/mxchange/addressbook/beans/user/AddressbookAdminUserWebSessionBean.java - * ZIP code - */ - private Integer zipCode; - - /** - * Regular user controller - */ - @Inject - private JobsUserWebSessionController userController; - /** * Default constructor */ -- 2.39.5