]> git.mxchange.org Git - jjobs-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Mon, 29 Aug 2016 13:05:01 +0000 (15:05 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 29 Aug 2016 17:31:59 +0000 (19:31 +0200)
- if other user name than current (but maybe other passphrase) one is entered, only then check for it's existence
- this avoids double-registering by administrator
- set user name in administrative controller, too

Signed-off-by: Roland Häder <roland@haeder.net>
Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jjobs/beans/helper/JobsWebViewHelperBean.java
src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java

index dcc1a4f7e334e9dac7583d2b1f2a5c27bde3a129..3d4fbd70eee193c9d9ee1e0857909f95a3dd17df 100644 (file)
@@ -24,6 +24,7 @@ import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jjobs.beans.BaseJobsController;
 import org.mxchange.jjobs.beans.contact.JobsAdminContactWebRequestController;
 import org.mxchange.jjobs.beans.phone.JobsAdminPhoneWebRequestController;
+import org.mxchange.jjobs.beans.user.JobsAdminUserWebRequestController;
 import org.mxchange.jjobs.beans.user.JobsUserWebSessionController;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
@@ -61,6 +62,12 @@ public class JobsWebViewHelperBean extends BaseJobsController implements JobsWeb
        @Inject
        private JobsAdminPhoneWebRequestController adminPhoneController;
 
+       /**
+        * Administrative user controller
+        */
+       @Inject
+       private JobsAdminUserWebRequestController adminUserController;
+
        /**
         * Contact instance
         */
@@ -268,6 +275,7 @@ public class JobsWebViewHelperBean extends BaseJobsController implements JobsWeb
 
                // Set all fields: user
                this.userController.setUserName(this.getUser().getUserName());
+               this.adminUserController.setUserName(this.getUser().getUserName());
        }
 
        @Override
index 0bcf903ec200499b5d5f79b5afecd57c5621f9a7..1776e0e50a5d28add8bdad1de36bbd61d080ff3e 100644 (file)
@@ -419,7 +419,7 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
 
                        // Throw exception
                        throw new FaceletException("Not same password entered"); //NOI18N
-               } else if (this.userBean.ifUserNameExists(this.getUserName())) {
+               } else if ((!Objects.equals(user.getUserName(), this.getUserName())) && (this.userBean.ifUserNameExists(this.getUserName()))) {
                        // User name already exists
                        throw new FaceletException(new UserNameAlreadyRegisteredException(this.getUserName()));
                } else if (this.isSamePasswordEntered()) {