From 062602dedfda677701babe53815aadbc433a024e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 12 Jul 2017 21:30:17 +0200 Subject: [PATCH] Please cherry-pick: - imported from new package MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- lib/juser-login-core.jar | Bin 0 -> 28992 bytes lib/juser-login-lib.jar | Bin 0 -> 4532 bytes nbproject/project.properties | 8 +- nbproject/project.xml | 10 +- .../JobsAddressbookWebSessionBean.java | 2 +- .../JobsAddressbookWebSessionController.java | 2 +- .../contact/JobsContactWebSessionBean.java | 146 +---------- .../JobsLocalizationSessionBean.java | 4 +- .../user/JobsAdminUserWebRequestBean.java | 16 +- .../beans/user/JobsUserWebSessionBean.java | 14 +- .../JobsUserActivityWebApplicationBean.java | 237 ++++++------------ ...sUserActivityWebApplicationController.java | 105 -------- .../JobsConfirmationLinkWebRequestBean.java | 4 +- .../JobsEmailChangeWebSessionBean.java | 2 +- .../login/JobsUserLoginWebSessionBean.java | 24 +- .../JobsUserPasswordWebRequestBean.java | 12 +- .../JobsUserRegisterWebSessionBean.java | 14 +- .../JobsResendLinkWebSessionBean.java | 6 +- 18 files changed, 151 insertions(+), 455 deletions(-) create mode 100644 lib/juser-login-core.jar create mode 100644 lib/juser-login-lib.jar diff --git a/lib/juser-login-core.jar b/lib/juser-login-core.jar new file mode 100644 index 0000000000000000000000000000000000000000..be51922603bba21188144f56e2fb5bd097a66535 GIT binary patch literal 28992 zcmeHQ349#YdH>$(nAK_}S?fbaV0(Q^TCEP-@_k8`WLvf_BpEDonDuHbFP3)2?#kGJ zNl3}rq$vpmOi4({K|>C}1Y3rJLz0pvq)F2@N86;iXwn?CIhv%oAph^p%+AhUn)Mah zpQYdI%+9>|-uJ%yz4yJh{ksYZT|`czD?jp+os{%fLWR`RIn>tB)w`|f<&@~5}9FB%ArsowTT zbRrTB!~wjn%vI(xaZGJaA#jXDN1L*jDA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gAl%ZhS|S~5%;C-7!BdJHBa9Q_A$zUK?bi83`Uk^ znD8&*zft^`$LAbYg)w}}z&Ori;0jQN97TzVa511n`|VFBdu2qS>oXKmSr-brfXn3O zEuYvjm&ftuMi86~ZnQW?KJo?wp8Vv8**ZUF@ZK=i3=RA_KO|+)G(AUHEey#kUGvB~ z28W5!2Ehhr&dbT`IhetK7Oo$eTANF^afcfW<`bJZ_c?>tg}c_)gjqEV2lG@IsE_S$ z$A6u3lK#^RkCQa?AHtzw^w~fsS4}*V7{@&q1sr1V@!%$+Fkv^J4b?}->?s`qe@Bsu zjE-pdlp#vu+&I#a-WBKPTpu6$%hP2nS+YE3us~7d`+V?=6Ben>b(WbPIlHYv z4IGp3PnCXy&P6skJ=I}t4k^%h@oXONfoiDfQ7ukQh#a)|Z}>o8)dli>wjF~cvxf?gnix6AvhNb%$${file.reference.juser-activity-core.jar} - ${file.reference.jcontacts-business-core.jar} + ${file.reference.juser-login-core.jar} - ${file.reference.jcontacts-business-lib.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.jaddressbook-core.jar} diff --git a/src/java/org/mxchange/jjobs/beans/addressbook/JobsAddressbookWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/addressbook/JobsAddressbookWebSessionBean.java index d5f45d7c..a883a7f0 100644 --- a/src/java/org/mxchange/jjobs/beans/addressbook/JobsAddressbookWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/addressbook/JobsAddressbookWebSessionBean.java @@ -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) diff --git a/src/java/org/mxchange/jjobs/beans/addressbook/JobsAddressbookWebSessionController.java b/src/java/org/mxchange/jjobs/beans/addressbook/JobsAddressbookWebSessionController.java index bc3fa3d0..ee30ec31 100644 --- a/src/java/org/mxchange/jjobs/beans/addressbook/JobsAddressbookWebSessionController.java +++ b/src/java/org/mxchange/jjobs/beans/addressbook/JobsAddressbookWebSessionController.java @@ -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 diff --git a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java index fddd64e2..c36b830c 100644 --- a/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/contact/JobsContactWebSessionBean.java @@ -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. - *

- * @param parameterKey Property key - *

- * @return Property value - *

- * @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. - *

- * @param parameterKey Property key - *

- * @return Property value - *

- * @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 - *

- * @param controllerName Name of controller - *

- * @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. - *

- * @param locale Locale from e.g. FacesContext - *

- * @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. - *

- * @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. - *

- * @param clientId Client id to send message to - * @param i18nKey Message key - *

- * @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)); - } - } diff --git a/src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionBean.java b/src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionBean.java index 8b699463..21b49eb9 100644 --- a/src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/localization/JobsLocalizationSessionBean.java @@ -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. diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java index b13849c1..8ee995be 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsAdminUserWebRequestBean.java @@ -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 diff --git a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java index 3aab2978..751a7420 100644 --- a/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/JobsUserWebSessionBean.java @@ -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); diff --git a/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationBean.java b/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationBean.java index 5317d968..0adf5d0c 100644 --- a/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationBean.java @@ -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 + *

+ * @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) + *

+ * @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 + *

+ * @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 + *

+ * @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 + *

+ * @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 + *

+ * @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. + *

+ * @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 + *

+ * @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 + *

+ * @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 + *

+ * @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 + *

+ * @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). + *

+ * @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 + *

+ * @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. - *

- * @param parameterKey Property key - *

- * @return Property value - *

- * @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. - *

- * @param parameterKey Property key - *

- * @return Property value - *

- * @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 - *

- * @param controllerName Name of controller - *

- * @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. - *

- * @param locale Locale from e.g. FacesContext - *

- * @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. - *

- * @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. - *

- * @param clientId Client id to send message to - * @param i18nKey Message key - *

- * @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)); - } - } diff --git a/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationController.java b/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationController.java index 5801699f..1a349957 100644 --- a/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationController.java +++ b/src/java/org/mxchange/jjobs/beans/user/activity/JobsUserActivityWebApplicationController.java @@ -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 - *

- * @param event Event being fired - */ - void afterAdminAddedUserEvent (final ObservableAdminAddedUserEvent event); - - /** - * Event observer for deleted user accounts (by administrator) - *

- * @param event Event being fired - */ - void afterAdminDeletedUserEvent (final ObservableAdminDeletedUserEvent event); - - /** - * Event observer for linked users with existing contact data - *

- * @param event Event being fired - */ - void afterAdminLinkedUserEvent (final ObservableAdminLinkedUserEvent event); - - /** - * Event observer for locked users - *

- * @param event Event being fired - */ - void afterAdminLockedUserEvent (final ObservableAdminLockedUserEvent event); - - /** - * Event observer for unlocked users - *

- * @param event Event being fired - */ - void afterAdminUnlockedUserEvent (final ObservableAdminUnlockedUserEvent event); - - /** - * Event observer for updated user data by administrator - *

- * @param event Event being updated - */ - void afterAdminUpdatedUserDataEvent (final ObservableAdminUpdatedUserDataEvent event); - - /** - * Event observer when user confirmed account. - *

- * @param event Event being fired - */ - void afterUserConfirmedAccountEvent (final ObservableUserConfirmedAccountEvent event); - - /** - * Event observer for logged-out user - *

- * @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). - *

- * @param event Event being observed - */ - void afterUserUpdatedPasswordEvent (final ObservableUpdatedUserPasswordEvent event); - - /** - * Listens to fired event when user updated personal data - *

- * @param event Event being fired - */ - void afterUserUpdatedPersonalDataEvent (final ObservableUpdatedUserPersonalDataEvent event); - - /** - * Event observer for new user registrations - *

- * @param event Event being fired - */ - void afterUserRegistrationEvent (final ObservableUserRegisteredEvent event); - - /** - * Event observer for logged-in user - *

- * @param event Event being fired - */ - void afterUserLoginEvent (final ObservableUserLoggedInEvent event); - - /** - * Event observer for users resending their confirmation link - *

- * @param event Event being fired - */ - void afterUserResendConfirmationLinkEvent (final ObservableUserResendLinkAccountEvent event); - /** * Adds user activity entry with given type *

diff --git a/src/java/org/mxchange/jjobs/beans/user/confirmlink/JobsConfirmationLinkWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/confirmlink/JobsConfirmationLinkWebRequestBean.java index 7a8c0d1e..40adc257 100644 --- a/src/java/org/mxchange/jjobs/beans/user/confirmlink/JobsConfirmationLinkWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/confirmlink/JobsConfirmationLinkWebRequestBean.java @@ -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 diff --git a/src/java/org/mxchange/jjobs/beans/user/email_address/JobsEmailChangeWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/user/email_address/JobsEmailChangeWebSessionBean.java index 2e4e0599..a14c96fb 100644 --- a/src/java/org/mxchange/jjobs/beans/user/email_address/JobsEmailChangeWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/email_address/JobsEmailChangeWebSessionBean.java @@ -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 diff --git a/src/java/org/mxchange/jjobs/beans/user/login/JobsUserLoginWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/user/login/JobsUserLoginWebSessionBean.java index aa689e8e..53fd7dae 100644 --- a/src/java/org/mxchange/jjobs/beans/user/login/JobsUserLoginWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/login/JobsUserLoginWebSessionBean.java @@ -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; diff --git a/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java b/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java index 0012ec36..9fba63ba 100644 --- a/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/password/JobsUserPasswordWebRequestBean.java @@ -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); diff --git a/src/java/org/mxchange/jjobs/beans/user/register/JobsUserRegisterWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/user/register/JobsUserRegisterWebSessionBean.java index 0fe7d1eb..ece4b929 100644 --- a/src/java/org/mxchange/jjobs/beans/user/register/JobsUserRegisterWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/register/JobsUserRegisterWebSessionBean.java @@ -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); diff --git a/src/java/org/mxchange/jjobs/beans/user/resendlink/JobsResendLinkWebSessionBean.java b/src/java/org/mxchange/jjobs/beans/user/resendlink/JobsResendLinkWebSessionBean.java index 530698c7..74732530 100644 --- a/src/java/org/mxchange/jjobs/beans/user/resendlink/JobsResendLinkWebSessionBean.java +++ b/src/java/org/mxchange/jjobs/beans/user/resendlink/JobsResendLinkWebSessionBean.java @@ -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 -- 2.39.5