]> git.mxchange.org Git - jjobs-war.git/commitdiff
Injected contact controller as now stuff around contacts are done there, not in user.
authorRoland Haeder <roland@mxchange.org>
Wed, 20 Apr 2016 17:42:19 +0000 (19:42 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 20 Apr 2016 19:48:33 +0000 (21:48 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jjobs/beans/register/JobsUserRegisterWebSessionBean.java
src/java/org/mxchange/jjobs/beans/register/JobsUserRegisterWebSessionController.java
src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java

index 16290bbc5933af3d20ed17e5fcb3fbf68696bb3f..dca9fc6c8f9874561df394720e2d42c3e60fa4b4 100644 (file)
@@ -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
index e414b7d279113fef2dce3ed1b41ba6717f26be90..209999b105bb9380d3ad11efe9120715b2855065 100644 (file)
@@ -32,4 +32,5 @@ public interface JobsUserRegisterWebSessionController extends Serializable {
         * @return Redirection target
         */
        String doRegister ();
+
 }
index 73526feef0834478b8d71cbb8072f0d8128c4c55..b58623e1326185dbac09e1dad6cbb1a0747fc00f 100644 (file)
@@ -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
         */