]> git.mxchange.org Git - jjobs-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Wed, 12 Jul 2017 19:30:17 +0000 (21:30 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 12 Jul 2017 20:27:09 +0000 (22:27 +0200)
- imported from new package

Signed-off-by: Roland Häder <roland@mxchange.org>
18 files changed:
lib/juser-login-core.jar [new file with mode: 0644]
lib/juser-login-lib.jar [new file with mode: 0644]
nbproject/project.properties
nbproject/project.xml
src/java/org/mxchange/jjobs/beans/addressbook/JobsAddressbookWebSessionBean.java
src/java/org/mxchange/jjobs/beans/addressbook/JobsAddressbookWebSessionController.java
src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java
src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionBean.java
src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationBean.java
src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationController.java
src/java/org/mxchange/jjobs/beans/user/confirmlink/JobsConfirmationLinkWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/email_address/JobsEmailChangeWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/login/JobsUserLoginWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java
src/java/org/mxchange/jjobs/beans/user/register/JobsUserRegisterWebSessionBean.java
src/java/org/mxchange/jjobs/beans/user/resendlink/JobsResendLinkWebSessionBean.java

diff --git a/lib/juser-login-core.jar b/lib/juser-login-core.jar
new file mode 100644 (file)
index 0000000..be51922
Binary files /dev/null and b/lib/juser-login-core.jar differ
diff --git a/lib/juser-login-lib.jar b/lib/juser-login-lib.jar
new file mode 100644 (file)
index 0000000..d3b43b4
Binary files /dev/null and b/lib/juser-login-lib.jar differ
index c6dde2eddd1f01756359517524a3229876ec145c..9c48c459cefee00e88b6e1fd03addd32b0d7154a 100644 (file)
@@ -53,6 +53,8 @@ file.reference.juser-activity-core.jar=lib/juser-activity-core.jar
 file.reference.juser-activity-lib.jar=lib/juser-activity-lib.jar
 file.reference.juser-core.jar=lib/juser-core.jar
 file.reference.juser-lib.jar=lib/juser-lib.jar
+file.reference.juser-login-core.jar=lib/juser-login-core.jar
+file.reference.juser-login-lib.jar=lib/juser-login-lib.jar
 includes=**
 j2ee.compile.on.save=true
 j2ee.copy.static.files.on.save=true
@@ -78,9 +80,11 @@ javac.classpath=\
     ${file.reference.juser-core.jar}:\
     ${file.reference.juser-lib.jar}:\
     ${file.reference.juser-activity-core.jar}:\
+    ${file.reference.juser-login-core.jar}:\
+    ${file.reference.juser-login-lib.jar}:\
+    ${file.reference.juser-activity-lib.jar}:\
     ${file.reference.jcontacts-business-core.jar}:\
     ${file.reference.jcontacts-business-lib.jar}:\
-    ${file.reference.juser-activity-lib.jar}:\
     ${file.reference.jaddressbook-core.jar}:\
     ${file.reference.jaddressbook-lib.jar}:\
     ${reference.jjobs-core.jar}:\
@@ -149,6 +153,8 @@ source.reference.juser-core.jar=../juser-core/src/
 source.reference.juser-lib.jar=../juser-lib/src/
 source.reference.jaddressbook-core.jar=../jaddressbook-core/src/
 source.reference.jaddressbook-lib.jar=../jaddressbook-lib/src/
+source.reference.juser-login-core.jar=../juser-login-core/src/
+source.reference.juser-login-lib.jar=../juser-login-lib/src/
 source.root=src
 src.dir=${source.root}/java
 test.src.dir=test
index 2d24ce94eab70b1966e272e76df78699f1796cbb..86216d80501730eda378395ad3b8da225dd35a4a 100644 (file)
                     <file>${file.reference.juser-activity-core.jar}</file>
                 </library>
                 <library dirs="200">
-                    <file>${file.reference.jcontacts-business-core.jar}</file>
+                    <file>${file.reference.juser-login-core.jar}</file>
                 </library>
                 <library dirs="200">
-                    <file>${file.reference.jcontacts-business-lib.jar}</file>
+                    <file>${file.reference.juser-login-lib.jar}</file>
                 </library>
                 <library dirs="200">
                     <file>${file.reference.juser-activity-lib.jar}</file>
                 </library>
+                <library dirs="200">
+                    <file>${file.reference.jcontacts-business-core.jar}</file>
+                </library>
+                <library dirs="200">
+                    <file>${file.reference.jcontacts-business-lib.jar}</file>
+                </library>
                 <library dirs="200">
                     <file>${file.reference.jaddressbook-core.jar}</file>
                 </library>
index d5f45d7c5e3f0933ebb9dc65a45c2c73d90bf9cf..a883a7f04d822480a19e78b42c9dcb5348780574 100644 (file)
@@ -43,8 +43,8 @@ import org.mxchange.jaddressbook.model.addressbook.UserAddressbook;
 import org.mxchange.jaddressbook.model.addressbook.entry.AddressbookEntry;
 import org.mxchange.jjobs.beans.BaseJobsController;
 import org.mxchange.jjobs.beans.user.login.JobsUserLoginWebSessionController;
-import org.mxchange.jusercore.events.login.ObservableUserLoggedInEvent;
 import org.mxchange.jusercore.model.user.User;
+import org.mxchange.juserlogincore.events.login.ObservableUserLoggedInEvent;
 
 /**
  * An address book bean (controller)
index bc3fa3d06643a37cfe306a9c5b5a5c7b8c1e2db2..ee30ec31a3ce36dba36fe4221e6223493e18e639 100644 (file)
@@ -22,8 +22,8 @@ import java.util.List;
 import org.mxchange.jaddressbook.events.addressbook.ObservableAddressbookLoadedEvent;
 import org.mxchange.jaddressbook.model.addressbook.Addressbook;
 import org.mxchange.jaddressbook.model.addressbook.entry.AddressbookEntry;
-import org.mxchange.jusercore.events.login.ObservableUserLoggedInEvent;
 import org.mxchange.jusercore.model.user.User;
+import org.mxchange.juserlogincore.events.login.ObservableUserLoggedInEvent;
 
 /**
  * An interface for address book beans
index fddd64e27314393c4707814b6b459437c9459b71..c36b830c636b503374cabb01b5359d8b4dc3bb9f 100644 (file)
@@ -22,15 +22,10 @@ import java.util.Date;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Locale;
-import java.util.MissingResourceException;
 import java.util.Objects;
-import java.util.ResourceBundle;
 import javax.annotation.PostConstruct;
 import javax.enterprise.context.SessionScoped;
 import javax.enterprise.event.Observes;
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
 import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
@@ -39,16 +34,16 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jcontacts.contact.Contact;
 import org.mxchange.jcontacts.contact.ContactSessionBeanRemote;
+import org.mxchange.jcontacts.contact.ContactUtils;
 import org.mxchange.jcontacts.contact.UserContact;
 import org.mxchange.jcontacts.contact.title.PersonalTitle;
-import org.mxchange.jcontacts.contact.ContactUtils;
 import org.mxchange.jcontacts.events.contact.add.ObservableAdminAddedContactEvent;
 import org.mxchange.jcontacts.events.contact.update.ObservableAdminUpdatedContactEvent;
 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
 import org.mxchange.jcountry.data.Country;
 import org.mxchange.jjobs.beans.BaseJobsController;
-import org.mxchange.jjobs.beans.user.login.JobsUserLoginWebSessionController;
 import org.mxchange.jjobs.beans.user.JobsUserWebSessionController;
+import org.mxchange.jjobs.beans.user.login.JobsUserLoginWebSessionController;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.fax.FaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
@@ -56,13 +51,13 @@ import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
 import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.phonenumbers.mobile.MobileNumber;
 import org.mxchange.jphone.phonenumbers.mobileprovider.MobileProvider;
-import org.mxchange.jusercore.events.confirmation.ObservableUserConfirmedAccountEvent;
-import org.mxchange.jusercore.events.login.ObservableUserLoggedInEvent;
-import org.mxchange.jusercore.events.registration.ObservableUserRegisteredEvent;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent;
-import org.mxchange.jusercore.exceptions.UserPasswordMismatchException;
 import org.mxchange.jusercore.model.user.User;
+import org.mxchange.juserlogincore.events.confirmation.ObservableUserConfirmedAccountEvent;
+import org.mxchange.juserlogincore.events.login.ObservableUserLoggedInEvent;
+import org.mxchange.juserlogincore.events.registration.ObservableUserRegisteredEvent;
+import org.mxchange.juserlogincore.exceptions.UserPasswordMismatchException;
 
 /**
  * A general contact controller (bean)
@@ -71,7 +66,7 @@ import org.mxchange.jusercore.model.user.User;
  */
 @Named ("contactController")
 @SessionScoped
-public abstract class JobsContactWebSessionBean extends BaseJobsController implements JobsContactWebSessionController {
+public class JobsContactWebSessionBean extends BaseJobsController implements JobsContactWebSessionController {
 
        /**
         * Serial number
@@ -1173,131 +1168,4 @@ public abstract class JobsContactWebSessionBean extends BaseJobsController imple
                this.contactList.add(contact);
        }
 
-       /**
-        * Returns given property key or throws an exception if not found.
-        * <p>
-        * @param parameterKey Property key
-        * <p>
-        * @return Property value
-        * <p>
-        * @throws NullPointerException If given key is not found
-        * @throws NumberFormatException If no number is given in context parameter
-        */
-       protected int getIntegerContextParameter (final String parameterKey) throws NullPointerException, NumberFormatException {
-               // Get context parameter
-               Integer contextValue = Integer.parseInt(this.getStringContextParameter(parameterKey));
-               // Return it
-               return contextValue;
-       }
-
-       /**
-        * Returns given property key or throws an exception if not found.
-        * <p>
-        * @param parameterKey Property key
-        * <p>
-        * @return Property value
-        * <p>
-        * @throws NullPointerException If given key is not found
-        */
-       protected String getStringContextParameter (final String parameterKey) throws NullPointerException {
-               // Get context parameter
-               String contextValue = FacesContext.getCurrentInstance().getExternalContext().getInitParameter(parameterKey);
-               // Is it null?
-               if (null == contextValue) {
-                       // Throw NPE
-                       throw new NullPointerException(MessageFormat.format("parameterKey={0} is not set.", parameterKey)); //NOI18N
-               }
-               // Return it
-               return contextValue;
-       }
-
-       /**
-        * Checks whether debug mode is enabled for given controller
-        * <p>
-        * @param controllerName Name of controller
-        * <p>
-        * @return Whether debug mode is enabled
-        */
-       protected boolean isDebugModeEnabled (final String controllerName) {
-               // Parameters should be valid
-               if (null == controllerName) {
-                       // Throw NPE
-                       throw new NullPointerException("controllerName is null"); //NOI18N
-               } else if (controllerName.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("controllerName is empty"); //NOI18N
-               }
-               // Try to get context parameter
-               String contextParameter = this.getStringContextParameter(String.format("is_debug_%s_enabled", controllerName)); //NOI18N
-               // Is it set and true?
-               boolean isEnabled = Boolean.parseBoolean(contextParameter) == Boolean.TRUE;
-               // Return it
-               return isEnabled;
-       }
-
-       /**
-        * Loads resource bundle for given locale. This must be implemented per
-        * project so all projects can still customize their methods. Calling
-        * ResourceBundleloadBundle() in this class means that also the bundle files
-        * must be present here.
-        * <p>
-        * @param locale Locale from e.g. FacesContext
-        * <p>
-        * @return Initialized and loaded resource bundle
-        */
-       protected abstract ResourceBundle loadResourceBundle (final Locale locale);
-
-       /**
-        * Shows a faces message for given causing exception. The message from the
-        * exception is being inserted into the message.
-        * <p>
-        * @param clientId Client id to send message to
-        * @param cause    Causing exception
-        */
-       protected void showFacesMessage (final String clientId, final Throwable cause) {
-               // Get context and add message
-               this.showFacesMessage(clientId, cause.getMessage());
-       }
-
-       /**
-        * Shows a faces message with given message (i18n) key.
-        * <p>
-        * @param clientId Client id to send message to
-        * @param i18nKey  Message key
-        * <p>
-        * @throws NullPointerException If clientId or i18nKey is null
-        * @throws IllegalArgumentException If clientId or i18nKey is empty
-        */
-       protected void showFacesMessage (final String clientId, final String i18nKey) throws NullPointerException, IllegalArgumentException {
-               // Both parameter must be valid
-               if (null == clientId) {
-                       // Throw NPE
-                       throw new NullPointerException("clientId is null"); //NOI18N
-               } else if (clientId.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("clientId is null"); //NOI18N
-               } else if (null == i18nKey) {
-                       // Throw NPE
-                       throw new NullPointerException("i18nKey is null"); //NOI18N
-               } else if (i18nKey.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("i18nKey is null"); //NOI18N
-               }
-               // Get current locale
-               Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
-               // Get bundle bundle
-               ResourceBundle bundle = this.loadResourceBundle(locale);
-               // Default is i18nKey
-               String message = MessageFormat.format("!{0}!", i18nKey); //NOI18N
-               // Try it
-               try {
-                       // Get message
-                       message = bundle.getString(i18nKey);
-               } catch (final MissingResourceException ex) {
-                       // Did not find it, ignored
-               }
-               // Get context and add message
-               FacesContext.getCurrentInstance().addMessage(clientId, new FacesMessage(message));
-       }
-
 }
index 8b6994639926c616fe282d589e0a9629801c9966..21b49eb932483bab0d3fc97aa893da353b305441 100644 (file)
@@ -24,8 +24,8 @@ import javax.enterprise.event.Observes;
 import javax.faces.context.FacesContext;
 import javax.inject.Named;
 import org.mxchange.jjobs.beans.BaseJobsController;
-import org.mxchange.jusercore.events.login.ObservableUserLoggedInEvent;
-import org.mxchange.jusercore.events.logout.ObservableUserLogoutEvent;
+import org.mxchange.juserlogincore.events.login.ObservableUserLoggedInEvent;
+import org.mxchange.juserlogincore.events.logout.ObservableUserLogoutEvent;
 
 /**
  * A session-scoped bean for handling localization/internationalization changes.
index b13849c19e49513baca63ffb15420577c7b005f5..8ee995be32249392be0afc9d2e9393e0dac72d78 100644 (file)
@@ -37,8 +37,6 @@ import org.mxchange.jjobs.beans.contact.JobsAdminContactWebRequestController;
 import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
 import org.mxchange.jjobs.beans.helper.JobsWebRequestHelperController;
 import org.mxchange.jjobs.beans.localization.JobsLocalizationSessionController;
-import org.mxchange.jusercore.container.login.UserLoginContainer;
-import org.mxchange.jusercore.events.registration.ObservableUserRegisteredEvent;
 import org.mxchange.jusercore.events.user.add.AdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.delete.AdminDeletedUserEvent;
@@ -54,7 +52,6 @@ import org.mxchange.jusercore.events.user.update.ObservableAdminUpdatedUserDataE
 import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException;
 import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
-import org.mxchange.jusercore.exceptions.UserPasswordRepeatMismatchException;
 import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
 import org.mxchange.jusercore.exceptions.UserStatusLockedException;
 import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException;
@@ -62,9 +59,12 @@ import org.mxchange.jusercore.model.user.AdminUserSessionBeanRemote;
 import org.mxchange.jusercore.model.user.LoginUser;
 import org.mxchange.jusercore.model.user.User;
 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.juserlogincore.container.login.UserLoginContainer;
+import org.mxchange.juserlogincore.events.registration.ObservableUserRegisteredEvent;
+import org.mxchange.juserlogincore.exceptions.UserPasswordRepeatMismatchException;
+import org.mxchange.juserlogincore.login.UserLoginUtils;
 
 /**
  * A user controller (bean)
@@ -285,7 +285,7 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
                        return ""; //NOI18N
                } else if ((this.getUserPassword() == null && (this.getUserPasswordRepeat() == null)) || ((this.getUserPassword().isEmpty()) && (this.getUserPasswordRepeat().isEmpty()))) {
                        // Empty password entered, then generate one
-                       password = UserUtils.createRandomPassword(JobsUserWebSessionController.MINIMUM_PASSWORD_LENGTH);
+                       password = UserLoginUtils.createRandomPassword(JobsUserWebSessionController.MINIMUM_PASSWORD_LENGTH);
                } else if (!this.isSamePasswordEntered()) {
                        // Both passwords don't match
                        throw new FaceletException(new UserPasswordRepeatMismatchException(user));
@@ -299,7 +299,7 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
                assert (password.length() >= JobsUserWebSessionController.MINIMUM_PASSWORD_LENGTH) : "Password is not long enough."; //NOI18N
 
                // Encrypt password and set it
-               user.setUserEncryptedPassword(UserUtils.encryptPassword(password));
+               user.setUserEncryptedPassword(UserLoginUtils.encryptPassword(password));
 
                try {
                        // Now, that all is set, call EJB
@@ -430,7 +430,7 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
                        return ""; //NOI18N
                } else if (this.isSamePasswordEntered()) {
                        // Same password entered, create container
-                       if ((Objects.equals(user.getUserMustChangePassword(), this.getUserMustChangePassword())) && (UserUtils.ifPasswordMatches(new UserLoginContainer(user, this.getUserPassword())))) {
+                       if ((Objects.equals(user.getUserMustChangePassword(), this.getUserMustChangePassword())) && (UserLoginUtils.ifPasswordMatches(new UserLoginContainer(user, this.getUserPassword())))) {
                                // Clear password fields
                                this.setUserPassword(null);
                                this.setUserPasswordRepeat(null);
@@ -441,7 +441,7 @@ public class JobsAdminUserWebRequestBean extends BaseJobsController implements J
                        }
 
                        // Encrypt password
-                       encryptedPassword = UserUtils.encryptPassword(this.getUserPassword());
+                       encryptedPassword = UserLoginUtils.encryptPassword(this.getUserPassword());
                }
 
                // Set user name and flag
index 3aab297880c44c69d42a58373f135a81d0a56b17..751a742060a5a604bac239bccb23d937ce3f61f5 100644 (file)
@@ -38,26 +38,26 @@ import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
 import org.mxchange.jjobs.beans.features.JobsFeaturesWebApplicationController;
 import org.mxchange.jjobs.beans.localization.JobsLocalizationSessionController;
 import org.mxchange.jjobs.beans.user.login.JobsUserLoginWebSessionController;
-import org.mxchange.jusercore.events.confirmation.ObservableUserConfirmedAccountEvent;
-import org.mxchange.jusercore.events.login.ObservableUserLoggedInEvent;
-import org.mxchange.jusercore.events.registration.ObservableUserRegisteredEvent;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
 import org.mxchange.jusercore.events.user.delete.ObservableAdminDeletedUserEvent;
 import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent;
 import org.mxchange.jusercore.events.user.locked.ObservableAdminLockedUserEvent;
-import org.mxchange.jusercore.events.user.password_change.ObservableUpdatedUserPasswordEvent;
 import org.mxchange.jusercore.events.user.unlocked.ObservableAdminUnlockedUserEvent;
 import org.mxchange.jusercore.events.user.update.ObservableAdminUpdatedUserDataEvent;
 import org.mxchange.jusercore.events.user.update.ObservableUpdatedUserPersonalDataEvent;
 import org.mxchange.jusercore.events.user.update.UpdatedUserPersonalDataEvent;
 import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
-import org.mxchange.jusercore.exceptions.UserPasswordMismatchException;
 import org.mxchange.jusercore.model.user.LoginUser;
 import org.mxchange.jusercore.model.user.User;
 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.juserlogincore.events.confirmation.ObservableUserConfirmedAccountEvent;
+import org.mxchange.juserlogincore.events.login.ObservableUserLoggedInEvent;
+import org.mxchange.juserlogincore.events.registration.ObservableUserRegisteredEvent;
+import org.mxchange.juserlogincore.events.user.password_change.ObservableUpdatedUserPasswordEvent;
+import org.mxchange.juserlogincore.exceptions.UserPasswordMismatchException;
+import org.mxchange.juserlogincore.login.UserLoginUtils;
 
 /**
  * A user controller (bean)
@@ -519,7 +519,7 @@ public class JobsUserWebSessionBean extends BaseJobsController implements JobsUs
                        this.setUserProfileMode(ProfileMode.INVISIBLE);
 
                        // Generate random password
-                       String randomPassword = UserUtils.createRandomPassword(JobsUserWebSessionController.MINIMUM_PASSWORD_LENGTH);
+                       String randomPassword = UserLoginUtils.createRandomPassword(JobsUserWebSessionController.MINIMUM_PASSWORD_LENGTH);
 
                        // Set random password
                        this.setUserPassword(randomPassword);
index 5317d968da61a401205a2dece2a9aac11c5654c2..0adf5d0c65a6ccb341606bf225cdbf8455a5aecb 100644 (file)
@@ -22,15 +22,10 @@ import java.util.GregorianCalendar;
 import java.util.LinkedHashMap;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Locale;
 import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
 import javax.annotation.PostConstruct;
 import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.event.Observes;
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
 import javax.faces.view.facelets.FaceletException;
 import javax.inject.Inject;
 import javax.inject.Named;
@@ -38,25 +33,25 @@ import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jjobs.beans.BaseJobsController;
-import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jusercore.model.user.activity.LogableUserActivity;
-import org.mxchange.jusercore.model.user.activity.UserActivityLog;
-import org.mxchange.jusercore.model.user.activity.UserActivityLogSessionBeanRemote;
-import org.mxchange.jusercore.model.user.activity.comparator.UserActivityLogTimestampComparator;
-import org.mxchange.jusercore.events.confirmation.ObservableUserConfirmedAccountEvent;
-import org.mxchange.jusercore.events.login.ObservableUserLoggedInEvent;
-import org.mxchange.jusercore.events.registration.ObservableUserRegisteredEvent;
-import org.mxchange.jusercore.events.resendlink.ObservableUserResendLinkAccountEvent;
+import org.mxchange.jjobs.beans.helper.JobsWebRequestHelperController;
 import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
-import org.mxchange.jusercore.events.logout.ObservableUserLogoutEvent;
 import org.mxchange.jusercore.events.user.delete.ObservableAdminDeletedUserEvent;
 import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent;
 import org.mxchange.jusercore.events.user.locked.ObservableAdminLockedUserEvent;
-import org.mxchange.jusercore.events.user.password_change.ObservableUpdatedUserPasswordEvent;
 import org.mxchange.jusercore.events.user.unlocked.ObservableAdminUnlockedUserEvent;
 import org.mxchange.jusercore.events.user.update.ObservableAdminUpdatedUserDataEvent;
 import org.mxchange.jusercore.events.user.update.ObservableUpdatedUserPersonalDataEvent;
-import org.mxchange.jjobs.beans.helper.JobsWebRequestHelperController;
+import org.mxchange.jusercore.model.user.User;
+import org.mxchange.jusercore.model.user.activity.LogableUserActivity;
+import org.mxchange.jusercore.model.user.activity.UserActivityLog;
+import org.mxchange.jusercore.model.user.activity.UserActivityLogSessionBeanRemote;
+import org.mxchange.jusercore.model.user.activity.comparator.UserActivityLogTimestampComparator;
+import org.mxchange.juserlogincore.events.confirmation.ObservableUserConfirmedAccountEvent;
+import org.mxchange.juserlogincore.events.login.ObservableUserLoggedInEvent;
+import org.mxchange.juserlogincore.events.logout.ObservableUserLogoutEvent;
+import org.mxchange.juserlogincore.events.registration.ObservableUserRegisteredEvent;
+import org.mxchange.juserlogincore.events.resendlink.ObservableUserResendLinkAccountEvent;
+import org.mxchange.juserlogincore.events.user.password_change.ObservableUpdatedUserPasswordEvent;
 
 /**
  * A controller (bean) for user activity log
@@ -65,7 +60,7 @@ import org.mxchange.jjobs.beans.helper.JobsWebRequestHelperController;
  */
 @Named ("userActivityController")
 @ApplicationScoped
-public abstract class JobsUserActivityWebApplicationBean extends BaseJobsController implements JobsUserActivityWebApplicationController {
+public class JobsUserActivityWebApplicationBean extends BaseJobsController implements JobsUserActivityWebApplicationController {
 
        /**
         * Serial number
@@ -175,7 +170,11 @@ public abstract class JobsUserActivityWebApplicationBean extends BaseJobsControl
                this.addUserActivityToCache(userActivity);
        }
 
-       @Override
+       /**
+        * Event observer for newly added users by administrator
+        * <p>
+        * @param event Event being fired
+        */
        public void afterAdminAddedUserEvent (@Observes final ObservableAdminAddedUserEvent event) {
                // event should not be null
                if (null == event) {
@@ -196,7 +195,11 @@ public abstract class JobsUserActivityWebApplicationBean extends BaseJobsControl
                this.addUserActivity(event.getAddedUser(), "ADMIN_ADDED_USER_ACCOUNT"); //NOI18N
        }
 
-       @Override
+       /**
+        * Event observer for deleted user accounts (by administrator)
+        * <p>
+        * @param event Event being fired
+        */
        public void afterAdminDeletedUserEvent (@Observes final ObservableAdminDeletedUserEvent event) {
                // event should not be null
                if (null == event) {
@@ -217,7 +220,11 @@ public abstract class JobsUserActivityWebApplicationBean extends BaseJobsControl
                this.addUserActivity(event.getDeletedUser(), "ADMIN_DELETED_USER_ACCOUNT", event.getUserDeleteReason()); //NOI18N
        }
 
-       @Override
+       /**
+        * Event observer for linked users with existing contact data
+        * <p>
+        * @param event Event being fired
+        */
        public void afterAdminLinkedUserEvent (@Observes final ObservableAdminLinkedUserEvent event) {
                // event should not be null
                if (null == event) {
@@ -238,7 +245,11 @@ public abstract class JobsUserActivityWebApplicationBean extends BaseJobsControl
                this.addUserActivity(event.getLinkedUser(), "ADMIN_LINKED_USER_ACCOUNT"); //NOI18N
        }
 
-       @Override
+       /**
+        * Event observer for locked users
+        * <p>
+        * @param event Event being fired
+        */
        public void afterAdminLockedUserEvent (@Observes final ObservableAdminLockedUserEvent event) {
                // event should not be null
                if (null == event) {
@@ -259,7 +270,11 @@ public abstract class JobsUserActivityWebApplicationBean extends BaseJobsControl
                this.addUserActivity(event.getLockedUser(), "ADMIN_LOCKED_USER_ACCOUNT", event.getLockedUser().getUserLastLockedReason()); //NOI18N
        }
 
-       @Override
+       /**
+        * Event observer for unlocked users
+        * <p>
+        * @param event Event being fired
+        */
        public void afterAdminUnlockedUserEvent (@Observes final ObservableAdminUnlockedUserEvent event) {
                // event should not be null
                if (null == event) {
@@ -280,7 +295,11 @@ public abstract class JobsUserActivityWebApplicationBean extends BaseJobsControl
                this.addUserActivity(event.getUnlockedUser(), "ADMIN_UNLOCKED_USER_ACCOUNT"); //NOI18N
        }
 
-       @Override
+       /**
+        * Event observer for updated user data by administrator
+        * <p>
+        * @param event Event being updated
+        */
        public void afterAdminUpdatedUserDataEvent (@Observes final ObservableAdminUpdatedUserDataEvent event) {
                // event should not be null
                if (null == event) {
@@ -301,7 +320,11 @@ public abstract class JobsUserActivityWebApplicationBean extends BaseJobsControl
                this.addUserActivity(event.getUpdatedUser(), "ADMIN_UPDATED_USER_PERSONAL_DATA"); //NOI18N
        }
 
-       @Override
+       /**
+        * Event observer when user confirmed account.
+        * <p>
+        * @param event Event being fired
+        */
        public void afterUserConfirmedAccountEvent (@Observes final ObservableUserConfirmedAccountEvent event) {
                // event should not be null
                if (null == event) {
@@ -322,7 +345,11 @@ public abstract class JobsUserActivityWebApplicationBean extends BaseJobsControl
                this.addUserActivity(event.getConfirmedUser(), "USER_CONFIRMED_ACCOUNT"); //NOI18N
        }
 
-       @Override
+       /**
+        * Event observer for logged-in user
+        * <p>
+        * @param event Event being fired
+        */
        public void afterUserLoginEvent (@Observes final ObservableUserLoggedInEvent event) {
                // event should not be null
                if (null == event) {
@@ -343,7 +370,11 @@ public abstract class JobsUserActivityWebApplicationBean extends BaseJobsControl
                this.addUserActivity(event.getLoggedInUser(), "USER_LOGGED_IN"); //NOI18N
        }
 
-       @Override
+       /**
+        * Event observer for logged-out user
+        * <p>
+        * @param event Event instance
+        */
        public void afterUserLogoutEvent (@Observes final ObservableUserLogoutEvent event) {
                // event should not be null
                if (null == event) {
@@ -364,7 +395,11 @@ public abstract class JobsUserActivityWebApplicationBean extends BaseJobsControl
                this.addUserActivity(event.getLoggedOutUser(), "USER_LOGGED_OUT"); //NOI18N
        }
 
-       @Override
+       /**
+        * Event observer for new user registrations
+        * <p>
+        * @param event Event being fired
+        */
        public void afterUserRegistrationEvent (@Observes final ObservableUserRegisteredEvent event) {
                // event should not be null
                if (null == event) {
@@ -385,7 +420,11 @@ public abstract class JobsUserActivityWebApplicationBean extends BaseJobsControl
                this.addUserActivity(event.getRegisteredUser(), "USER_REGISTERED_NEW_ACCOUNT"); //NOI18N
        }
 
-       @Override
+       /**
+        * Event observer for users resending their confirmation link
+        * <p>
+        * @param event Event being fired
+        */
        public void afterUserResendConfirmationLinkEvent (@Observes final ObservableUserResendLinkAccountEvent event) {
                // event should not be null
                if (null == event) {
@@ -406,7 +445,12 @@ public abstract class JobsUserActivityWebApplicationBean extends BaseJobsControl
                this.addUserActivity(event.getResendLinkUser(), "USER_RESEND_CONFIRMATION_LINK"); //NOI18N
        }
 
-       @Override
+       /**
+        * Method being call after user's password has been updated (and history
+        * entry has been created).
+        * <p>
+        * @param event Event being observed
+        */
        public void afterUserUpdatedPasswordEvent (@Observes final ObservableUpdatedUserPasswordEvent event) {
                // Check parameter
                if (null == event) {
@@ -427,7 +471,11 @@ public abstract class JobsUserActivityWebApplicationBean extends BaseJobsControl
                this.addUserActivity(event.getPasswordHistory().getUserPasswordHistoryUser(), "USER_UPDATED_PASSWORD"); //NOI18N
        }
 
-       @Override
+       /**
+        * Listens to fired event when user updated personal data
+        * <p>
+        * @param event Event being fired
+        */
        public void afterUserUpdatedPersonalDataEvent (@Observes final ObservableUpdatedUserPersonalDataEvent event) {
                // Check parameter
                if (null == event) {
@@ -570,131 +618,4 @@ public abstract class JobsUserActivityWebApplicationBean extends BaseJobsControl
                this.usersActivity.get(userActivity.getActivityUser()).add(userActivity);
        }
 
-       /**
-        * Returns given property key or throws an exception if not found.
-        * <p>
-        * @param parameterKey Property key
-        * <p>
-        * @return Property value
-        * <p>
-        * @throws NullPointerException If given key is not found
-        * @throws NumberFormatException If no number is given in context parameter
-        */
-       protected int getIntegerContextParameter (final String parameterKey) throws NullPointerException, NumberFormatException {
-               // Get context parameter
-               Integer contextValue = Integer.parseInt(this.getStringContextParameter(parameterKey));
-               // Return it
-               return contextValue;
-       }
-
-       /**
-        * Returns given property key or throws an exception if not found.
-        * <p>
-        * @param parameterKey Property key
-        * <p>
-        * @return Property value
-        * <p>
-        * @throws NullPointerException If given key is not found
-        */
-       protected String getStringContextParameter (final String parameterKey) throws NullPointerException {
-               // Get context parameter
-               String contextValue = FacesContext.getCurrentInstance().getExternalContext().getInitParameter(parameterKey);
-               // Is it null?
-               if (null == contextValue) {
-                       // Throw NPE
-                       throw new NullPointerException(MessageFormat.format("parameterKey={0} is not set.", parameterKey)); //NOI18N
-               }
-               // Return it
-               return contextValue;
-       }
-
-       /**
-        * Checks whether debug mode is enabled for given controller
-        * <p>
-        * @param controllerName Name of controller
-        * <p>
-        * @return Whether debug mode is enabled
-        */
-       protected boolean isDebugModeEnabled (final String controllerName) {
-               // Parameters should be valid
-               if (null == controllerName) {
-                       // Throw NPE
-                       throw new NullPointerException("controllerName is null"); //NOI18N
-               } else if (controllerName.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("controllerName is empty"); //NOI18N
-               }
-               // Try to get context parameter
-               String contextParameter = this.getStringContextParameter(String.format("is_debug_%s_enabled", controllerName)); //NOI18N
-               // Is it set and true?
-               boolean isEnabled = Boolean.parseBoolean(contextParameter) == Boolean.TRUE;
-               // Return it
-               return isEnabled;
-       }
-
-       /**
-        * Loads resource bundle for given locale. This must be implemented per
-        * project so all projects can still customize their methods. Calling
-        * ResourceBundleloadBundle() in this class means that also the bundle files
-        * must be present here.
-        * <p>
-        * @param locale Locale from e.g. FacesContext
-        * <p>
-        * @return Initialized and loaded resource bundle
-        */
-       protected abstract ResourceBundle loadResourceBundle (final Locale locale);
-
-       /**
-        * Shows a faces message for given causing exception. The message from the
-        * exception is being inserted into the message.
-        * <p>
-        * @param clientId Client id to send message to
-        * @param cause    Causing exception
-        */
-       protected void showFacesMessage (final String clientId, final Throwable cause) {
-               // Get context and add message
-               this.showFacesMessage(clientId, cause.getMessage());
-       }
-
-       /**
-        * Shows a faces message with given message (i18n) key.
-        * <p>
-        * @param clientId Client id to send message to
-        * @param i18nKey  Message key
-        * <p>
-        * @throws NullPointerException If clientId or i18nKey is null
-        * @throws IllegalArgumentException If clientId or i18nKey is empty
-        */
-       protected void showFacesMessage (final String clientId, final String i18nKey) throws NullPointerException, IllegalArgumentException {
-               // Both parameter must be valid
-               if (null == clientId) {
-                       // Throw NPE
-                       throw new NullPointerException("clientId is null"); //NOI18N
-               } else if (clientId.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("clientId is null"); //NOI18N
-               } else if (null == i18nKey) {
-                       // Throw NPE
-                       throw new NullPointerException("i18nKey is null"); //NOI18N
-               } else if (i18nKey.isEmpty()) {
-                       // Is empty
-                       throw new IllegalArgumentException("i18nKey is null"); //NOI18N
-               }
-               // Get current locale
-               Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
-               // Get bundle bundle
-               ResourceBundle bundle = this.loadResourceBundle(locale);
-               // Default is i18nKey
-               String message = MessageFormat.format("!{0}!", i18nKey); //NOI18N
-               // Try it
-               try {
-                       // Get message
-                       message = bundle.getString(i18nKey);
-               } catch (final MissingResourceException ex) {
-                       // Did not find it, ignored
-               }
-               // Get context and add message
-               FacesContext.getCurrentInstance().addMessage(clientId, new FacesMessage(message));
-       }
-
 }
index 5801699f9e4c3f9fbbdcadd216d0f4419888571a..1a349957c8bd70067e0f0c728adea42e91cc2a7e 100644 (file)
@@ -21,19 +21,6 @@ import java.util.List;
 import javax.ejb.Local;
 import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.activity.LogableUserActivity;
-import org.mxchange.jusercore.events.confirmation.ObservableUserConfirmedAccountEvent;
-import org.mxchange.jusercore.events.login.ObservableUserLoggedInEvent;
-import org.mxchange.jusercore.events.registration.ObservableUserRegisteredEvent;
-import org.mxchange.jusercore.events.resendlink.ObservableUserResendLinkAccountEvent;
-import org.mxchange.jusercore.events.user.add.ObservableAdminAddedUserEvent;
-import org.mxchange.jusercore.events.logout.ObservableUserLogoutEvent;
-import org.mxchange.jusercore.events.user.delete.ObservableAdminDeletedUserEvent;
-import org.mxchange.jusercore.events.user.linked.ObservableAdminLinkedUserEvent;
-import org.mxchange.jusercore.events.user.locked.ObservableAdminLockedUserEvent;
-import org.mxchange.jusercore.events.user.password_change.ObservableUpdatedUserPasswordEvent;
-import org.mxchange.jusercore.events.user.unlocked.ObservableAdminUnlockedUserEvent;
-import org.mxchange.jusercore.events.user.update.ObservableAdminUpdatedUserDataEvent;
-import org.mxchange.jusercore.events.user.update.ObservableUpdatedUserPersonalDataEvent;
 
 /**
  * A controller (bean) interface for user activity log
@@ -43,98 +30,6 @@ import org.mxchange.jusercore.events.user.update.ObservableUpdatedUserPersonalDa
 @Local
 public interface JobsUserActivityWebApplicationController extends Serializable {
 
-       /**
-        * Event observer for newly added users by adminstrator
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminAddedUserEvent (final ObservableAdminAddedUserEvent event);
-
-       /**
-        * Event observer for deleted user accounts (by administrator)
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminDeletedUserEvent (final ObservableAdminDeletedUserEvent event);
-
-       /**
-        * Event observer for linked users with existing contact data
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminLinkedUserEvent (final ObservableAdminLinkedUserEvent event);
-
-       /**
-        * Event observer for locked users
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminLockedUserEvent (final ObservableAdminLockedUserEvent event);
-
-       /**
-        * Event observer for unlocked users
-        * <p>
-        * @param event Event being fired
-        */
-       void afterAdminUnlockedUserEvent (final ObservableAdminUnlockedUserEvent event);
-
-       /**
-        * Event observer for updated user data by administrator
-        * <p>
-        * @param event Event being updated
-        */
-       void afterAdminUpdatedUserDataEvent (final ObservableAdminUpdatedUserDataEvent event);
-
-       /**
-        * Event observer when user confirmed account.
-        * <p>
-        * @param event Event being fired
-        */
-       void afterUserConfirmedAccountEvent (final ObservableUserConfirmedAccountEvent event);
-
-       /**
-        * Event observer for logged-out user
-        * <p>
-        * @param event Event instance
-        */
-       void afterUserLogoutEvent (final ObservableUserLogoutEvent event);
-
-       /**
-        * Method being call after user's password has been updated (and history
-        * entry has been created).
-        * <p>
-        * @param event Event being observed
-        */
-       void afterUserUpdatedPasswordEvent (final ObservableUpdatedUserPasswordEvent event);
-
-       /**
-        * Listens to fired event when user updated personal data
-        * <p>
-        * @param event Event being fired
-        */
-       void afterUserUpdatedPersonalDataEvent (final ObservableUpdatedUserPersonalDataEvent event);
-
-       /**
-        * Event observer for new user registrations
-        * <p>
-        * @param event Event being fired
-        */
-       void afterUserRegistrationEvent (final ObservableUserRegisteredEvent event);
-
-       /**
-        * Event observer for logged-in user
-        * <p>
-        * @param event Event being fired
-        */
-       void afterUserLoginEvent (final ObservableUserLoggedInEvent event);
-
-       /**
-        * Event observer for users resending their confirmation link
-        * <p>
-        * @param event Event being fired
-        */
-       void afterUserResendConfirmationLinkEvent (final ObservableUserResendLinkAccountEvent event);
-
        /**
         * Adds user activity entry with given type
         * <p>
index 7a8c0d1e3c8c2b45911c8c0493ff6db4111d793a..40adc2574701423eab0ee2351c925fcd5dbd8ed0 100644 (file)
@@ -34,13 +34,13 @@ import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jjobs.beans.BaseJobsController;
 import org.mxchange.jjobs.beans.helper.JobsWebRequestHelperController;
 import org.mxchange.jjobs.beans.user.JobsUserWebSessionController;
-import org.mxchange.jusercore.events.confirmation.ObservableUserConfirmedAccountEvent;
-import org.mxchange.jusercore.events.confirmation.UserConfirmedAccountEvent;
 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.juserlogincore.events.confirmation.ObservableUserConfirmedAccountEvent;
+import org.mxchange.juserlogincore.events.confirmation.UserConfirmedAccountEvent;
 
 /**
  * A web request bean for confirmation link handling
index 2e4e05997b075dce533c64e903dbba22969c8f65..a14c96fb2c02796bccf210abf758e356d3559810 100644 (file)
@@ -32,11 +32,11 @@ import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jjobs.beans.BaseJobsController;
 import org.mxchange.jjobs.beans.features.JobsFeaturesWebApplicationController;
 import org.mxchange.jjobs.beans.user.login.JobsUserLoginWebSessionController;
-import org.mxchange.jusercore.exceptions.UserPasswordMismatchException;
 import org.mxchange.jusercore.model.email_address.ChangeableEmailAddress;
 import org.mxchange.jusercore.model.email_address.EmailAddressChange;
 import org.mxchange.jusercore.model.user.email_address.UserEmailChangeSessionBeanRemote;
 import org.mxchange.jusercore.model.user.User;
+import org.mxchange.juserlogincore.exceptions.UserPasswordMismatchException;
 
 /**
  * A web session-scoped bean for changing email addresses
index aa689e8eb0f25dc1ece0fa0ef0d4da142c34b416..53fd7daed795f08f93c0a9fb20c96816731b2e0f 100644 (file)
@@ -34,24 +34,24 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 import org.mxchange.jjobs.beans.BaseJobsController;
 import org.mxchange.jjobs.beans.user.JobsUserWebSessionController;
-import org.mxchange.jusercore.container.login.LoginContainer;
-import org.mxchange.jusercore.container.login.UserLoginContainer;
-import org.mxchange.jusercore.events.login.ObservableUserLoggedInEvent;
-import org.mxchange.jusercore.events.login.UserLoggedInEvent;
-import org.mxchange.jusercore.events.logout.ObservableUserLogoutEvent;
-import org.mxchange.jusercore.events.logout.UserLogoutEvent;
-import org.mxchange.jusercore.events.user.password_change.ObservableUpdatedUserPasswordEvent;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
-import org.mxchange.jusercore.exceptions.UserPasswordMismatchException;
 import org.mxchange.jusercore.exceptions.UserStatusLockedException;
 import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException;
-import org.mxchange.jusercore.model.login.user.UserLoginSessionBeanRemote;
 import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jusercore.model.user.UserUtils;
 import org.mxchange.jusercore.model.user.password_history.PasswordHistory;
 import org.mxchange.jusercore.model.user.password_history.UserPasswordHistorySessionBeanRemote;
 import org.mxchange.jusercore.model.user.profilemodes.ProfileMode;
 import org.mxchange.jusercore.model.user.status.UserAccountStatus;
+import org.mxchange.juserlogincore.container.login.LoginContainer;
+import org.mxchange.juserlogincore.container.login.UserLoginContainer;
+import org.mxchange.juserlogincore.events.login.ObservableUserLoggedInEvent;
+import org.mxchange.juserlogincore.events.login.UserLoggedInEvent;
+import org.mxchange.juserlogincore.events.logout.ObservableUserLogoutEvent;
+import org.mxchange.juserlogincore.events.logout.UserLogoutEvent;
+import org.mxchange.juserlogincore.events.user.password_change.ObservableUpdatedUserPasswordEvent;
+import org.mxchange.juserlogincore.exceptions.UserPasswordMismatchException;
+import org.mxchange.juserlogincore.login.UserLoginUtils;
+import org.mxchange.juserlogincore.model.login.user.UserLoginSessionBeanRemote;
 
 /**
  * A web bean for user registration
@@ -312,7 +312,7 @@ public class JobsUserLoginWebSessionBean extends BaseJobsController implements J
                LoginContainer container = new UserLoginContainer(this.getLoggedInUser(), this.getUserCurrentPassword());
 
                // Now check if it matches
-               return UserUtils.ifPasswordMatches(container, this.getLoggedInUser());
+               return UserLoginUtils.ifPasswordMatches(container, this.getLoggedInUser());
        }
 
        @Override
@@ -367,7 +367,7 @@ public class JobsUserLoginWebSessionBean extends BaseJobsController implements J
                // Check all passwords
                for (final PasswordHistory entry : this.getUserPasswordHistory()) {
                        // Is password the same?
-                       if (UserUtils.ifPasswordMatches(userPassword, entry.getUserPasswordHistoryUser())) {
+                       if (UserLoginUtils.ifPasswordMatches(userPassword, entry.getUserPasswordHistoryUser())) {
                                // Yes, found it
                                isPasswordInHistory = true;
                                break;
index 0012ec365886e9de538afc40d67c4171097afa6d..9fba63ba268abe66098a371eb4122ee90c892724 100644 (file)
@@ -31,16 +31,16 @@ import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jjobs.beans.BaseJobsController;
 import org.mxchange.jjobs.beans.features.JobsFeaturesWebApplicationController;
 import org.mxchange.jjobs.beans.user.login.JobsUserLoginWebSessionController;
-import org.mxchange.jusercore.events.user.password_change.ObservableUpdatedUserPasswordEvent;
-import org.mxchange.jusercore.events.user.password_change.UpdatedUserPasswordEvent;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
-import org.mxchange.jusercore.exceptions.UserPasswordMismatchException;
 import org.mxchange.jusercore.exceptions.UserStatusLockedException;
 import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException;
 import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
-import org.mxchange.jusercore.model.user.UserUtils;
 import org.mxchange.jusercore.model.user.password_history.PasswordHistory;
+import org.mxchange.juserlogincore.events.user.password_change.ObservableUpdatedUserPasswordEvent;
+import org.mxchange.juserlogincore.events.user.password_change.UpdatedUserPasswordEvent;
+import org.mxchange.juserlogincore.exceptions.UserPasswordMismatchException;
+import org.mxchange.juserlogincore.login.UserLoginUtils;
 
 /**
  * A user password (change) controller (bean)
@@ -118,7 +118,7 @@ public class JobsUserPasswordWebRequestBean extends BaseJobsController implement
                } else if (!this.featureController.isFeatureEnabled("change_user_password")) { //NOI18N
                        // Editing is not allowed
                        throw new IllegalStateException("User tried to change password."); //NOI18N
-               } else if (!UserUtils.ifPasswordMatches(this.getUserCurrentPassword(), this.userLoginController.getLoggedInUser())) {
+               } else if (!UserLoginUtils.ifPasswordMatches(this.getUserCurrentPassword(), this.userLoginController.getLoggedInUser())) {
                        // Password mismatches
                        this.showFacesMessage("form_user_change_password:userCurrentPassword", "Entered current password does not matched stored password."); //NOI18N
 
@@ -160,7 +160,7 @@ public class JobsUserPasswordWebRequestBean extends BaseJobsController implement
                User user = this.userLoginController.getLoggedInUser();
 
                // Encrypt password
-               String encryptedPassword = UserUtils.encryptPassword(this.getUserPassword());
+               String encryptedPassword = UserLoginUtils.encryptPassword(this.getUserPassword());
 
                // Set it in user
                user.setUserEncryptedPassword(encryptedPassword);
index 0fe7d1eb69cd5d012e326b456d1b906313f905b6..ece4b929b997865a4a6a565de1f7798d9c839578 100644 (file)
@@ -35,15 +35,15 @@ import org.mxchange.jjobs.beans.contact.JobsContactWebSessionController;
 import org.mxchange.jjobs.beans.features.JobsFeaturesWebApplicationController;
 import org.mxchange.jjobs.beans.user.JobsAdminUserWebRequestController;
 import org.mxchange.jjobs.beans.user.JobsUserWebSessionController;
-import org.mxchange.jusercore.events.registration.ObservableUserRegisteredEvent;
-import org.mxchange.jusercore.events.registration.UserRegisteredEvent;
 import org.mxchange.jusercore.exceptions.DataRepeatMismatchException;
 import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException;
 import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException;
 import org.mxchange.jusercore.model.user.User;
-import org.mxchange.jusercore.model.user.UserUtils;
-import org.mxchange.jusercore.model.user.register.UserRegistrationSessionBeanRemote;
 import org.mxchange.jusercore.model.user.status.UserAccountStatus;
+import org.mxchange.juserlogincore.events.registration.ObservableUserRegisteredEvent;
+import org.mxchange.juserlogincore.events.registration.UserRegisteredEvent;
+import org.mxchange.juserlogincore.login.UserLoginUtils;
+import org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote;
 
 /**
  * A web bean for user registration
@@ -166,7 +166,7 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement
                                throw new FaceletException(new DataRepeatMismatchException("Passwords not matching.")); //NOI18N
                        } else if (this.userController.ifBothPasswordsEmptyAllowed()) {
                                // Both passwords are left empty and is allowed, then generate a random password
-                               randomPassword = UserUtils.createRandomPassword(JobsUserWebSessionController.MINIMUM_PASSWORD_LENGTH);
+                               randomPassword = UserLoginUtils.createRandomPassword(JobsUserWebSessionController.MINIMUM_PASSWORD_LENGTH);
 
                                // Set it in both fields
                                this.userController.setUserPassword(randomPassword);
@@ -175,7 +175,7 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement
                }
 
                // Encrypt password
-               String encryptedPassword = UserUtils.encryptPassword(this.userController.getUserPassword());
+               String encryptedPassword = UserLoginUtils.encryptPassword(this.userController.getUserPassword());
 
                // Set it here
                user.setUserEncryptedPassword(encryptedPassword);
@@ -255,7 +255,7 @@ public class JobsUserRegisterWebSessionBean extends BaseJobsController implement
                                return ""; //NOI18N
                        } else if (this.userController.ifBothPasswordsEmptyAllowed()) {
                                // Both passwords are left empty and is allowed, then generate a random password
-                               String randomPassword = UserUtils.createRandomPassword(JobsUserWebSessionController.MINIMUM_PASSWORD_LENGTH);
+                               String randomPassword = UserLoginUtils.createRandomPassword(JobsUserWebSessionController.MINIMUM_PASSWORD_LENGTH);
 
                                // Set it in both fields
                                this.userController.setUserPassword(randomPassword);
index 530698c7d73143eff05073dc0234b1f4e3f3e37c..74732530822d3cddbef0a520b9436efcc03ce03d 100644 (file)
@@ -30,15 +30,15 @@ import org.mxchange.jcoreee.utils.FacesUtils;
 import org.mxchange.jjobs.beans.BaseJobsController;
 import org.mxchange.jjobs.beans.localization.JobsLocalizationSessionController;
 import org.mxchange.jjobs.beans.user.JobsUserWebSessionController;
-import org.mxchange.jusercore.events.resendlink.ObservableUserResendLinkAccountEvent;
-import org.mxchange.jusercore.events.resendlink.UserResendLinkAccountEvent;
 import org.mxchange.jusercore.exceptions.UserEmailAddressNotFoundException;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 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.resendlink.ResendLinkSessionBeanRemote;
 import org.mxchange.jusercore.model.user.status.UserAccountStatus;
+import org.mxchange.juserlogincore.events.resendlink.ObservableUserResendLinkAccountEvent;
+import org.mxchange.juserlogincore.events.resendlink.UserResendLinkAccountEvent;
+import org.mxchange.juserlogincore.model.user.resendlink.ResendLinkSessionBeanRemote;
 
 /**
  * A web session-scoped bean for resending confirmation link