From cf48dc7df6ffe9c963f134f455479fb6445d9b5a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 20 Apr 2017 00:29:13 +0200 Subject: [PATCH] other projects will have more than one login, not just users (Java files) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../contact/FinancialsContactWebSessionBean.java | 6 +++--- .../FinancialsEmailChangeWebSessionBean.java | 12 ++++++------ .../login/FinancialsUserLoginWebSessionBean.java | 2 +- .../profile/FinancialsUserProfileWebRequestBean.java | 4 ++-- .../beans/user/FinancialsUserWebSessionBean.java | 12 ++++++------ .../password/FinancialsUserPasswordValidator.java | 6 +++--- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebSessionBean.java b/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebSessionBean.java index d6c1ddc7..69ee8672 100644 --- a/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebSessionBean.java +++ b/src/java/org/mxchange/jfinancials/beans/contact/FinancialsContactWebSessionBean.java @@ -561,9 +561,9 @@ public class FinancialsContactWebSessionBean extends BaseFinancialsController im Contact contact = this.userLoginController.getLoggedInUser().getUserContact(); // It should be there, so run some tests on it - assert (contact instanceof Contact) : "Instance loginController.loggedInUser.userContact is null"; //NOI18N - assert (contact.getContactId() instanceof Long) : "Instance loginController.userContact.contactId is null"; //NOI18N - assert (contact.getContactId() > 0) : MessageFormat.format("Instance loginController.userContact.contactId={0} is invalid", contact.getContactId()); //NOI18N + assert (contact instanceof Contact) : "Instance userLoginController.loggedInUser.userContact is null"; //NOI18N + assert (contact.getContactId() instanceof Long) : "Instance userLoginController.userContact.contactId is null"; //NOI18N + assert (contact.getContactId() > 0) : MessageFormat.format("Instance userLoginController.userContact.contactId={0} is invalid", contact.getContactId()); //NOI18N // Update all fields contact.setContactGender(this.getGender()); diff --git a/src/java/org/mxchange/jfinancials/beans/email_address/FinancialsEmailChangeWebSessionBean.java b/src/java/org/mxchange/jfinancials/beans/email_address/FinancialsEmailChangeWebSessionBean.java index 80dc7203..145bfcd2 100644 --- a/src/java/org/mxchange/jfinancials/beans/email_address/FinancialsEmailChangeWebSessionBean.java +++ b/src/java/org/mxchange/jfinancials/beans/email_address/FinancialsEmailChangeWebSessionBean.java @@ -128,12 +128,12 @@ public class FinancialsEmailChangeWebSessionBean extends BaseFinancialsControlle User user = this.userLoginController.getLoggedInUser(); // It should be there, so run some tests on it - assert (user instanceof User) : "Instance loginController.loggedInUser is null"; //NOI18N - assert (user.getUserId() instanceof Long) : "Instance loginController.loggedInUser.userId is null"; //NOI18N - assert (user.getUserId() > 0) : MessageFormat.format("loginController.loggedInUser.userId={0} is invalid", user.getUserId()); //NOI18N - assert (user.getUserContact() instanceof Contact) : "Instance loginController.loggedInUser.userContact is null"; //NOI18N - assert (user.getUserContact().getContactId() instanceof Long) : "Instance loginController.userContact.contactId is null"; //NOI18N - assert (user.getUserContact().getContactId() > 0) : MessageFormat.format("Instance loginController.userContact.contactId={0} is invalid", user.getUserContact().getContactId()); //NOI18N + assert (user instanceof User) : "Instance userLoginController.loggedInUser is null"; //NOI18N + assert (user.getUserId() instanceof Long) : "Instance userLoginController.loggedInUser.userId is null"; //NOI18N + assert (user.getUserId() > 0) : MessageFormat.format("userLoginController.loggedInUser.userId={0} is invalid", user.getUserId()); //NOI18N + assert (user.getUserContact() instanceof Contact) : "Instance userLoginController.loggedInUser.userContact is null"; //NOI18N + assert (user.getUserContact().getContactId() instanceof Long) : "Instance userLoginController.userContact.contactId is null"; //NOI18N + assert (user.getUserContact().getContactId() > 0) : MessageFormat.format("Instance userLoginController.userContact.contactId={0} is invalid", user.getUserContact().getContactId()); //NOI18N // Check if the email address is already enqueued if (this.isEmailAddressQueued(this.getEmailAddress())) { diff --git a/src/java/org/mxchange/jfinancials/beans/login/FinancialsUserLoginWebSessionBean.java b/src/java/org/mxchange/jfinancials/beans/login/FinancialsUserLoginWebSessionBean.java index c6cabd0e..c05a8f1c 100644 --- a/src/java/org/mxchange/jfinancials/beans/login/FinancialsUserLoginWebSessionBean.java +++ b/src/java/org/mxchange/jfinancials/beans/login/FinancialsUserLoginWebSessionBean.java @@ -57,7 +57,7 @@ import org.mxchange.jfinancials.beans.user.FinancialsUserWebSessionController; *

* @author Roland Häder */ -@Named ("loginController") +@Named ("userLoginController") @SessionScoped public class FinancialsUserLoginWebSessionBean extends BaseFinancialsController implements FinancialsUserLoginWebSessionController { diff --git a/src/java/org/mxchange/jfinancials/beans/profile/FinancialsUserProfileWebRequestBean.java b/src/java/org/mxchange/jfinancials/beans/profile/FinancialsUserProfileWebRequestBean.java index 23bf1e14..29a1f54e 100644 --- a/src/java/org/mxchange/jfinancials/beans/profile/FinancialsUserProfileWebRequestBean.java +++ b/src/java/org/mxchange/jfinancials/beans/profile/FinancialsUserProfileWebRequestBean.java @@ -46,7 +46,7 @@ public class FinancialsUserProfileWebRequestBean extends BaseFinancialsControlle * Login controller */ @Inject - private FinancialsUserLoginWebSessionController loginController; + private FinancialsUserLoginWebSessionController userLoginController; /** * User controller @@ -111,7 +111,7 @@ public class FinancialsUserProfileWebRequestBean extends BaseFinancialsControlle // Check all conditions (except for admin) return ((profileMode.equals(ProfileMode.PUBLIC)) || - (this.loginController.isUserLoggedIn()) && (profileMode.equals(ProfileMode.MEMBERS))); + (this.userLoginController.isUserLoggedIn()) && (profileMode.equals(ProfileMode.MEMBERS))); } } diff --git a/src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebSessionBean.java b/src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebSessionBean.java index 26383bec..db668607 100644 --- a/src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebSessionBean.java +++ b/src/java/org/mxchange/jfinancials/beans/user/FinancialsUserWebSessionBean.java @@ -504,12 +504,12 @@ public class FinancialsUserWebSessionBean extends BaseFinancialsController imple this.contactController.updateContactDataFromController(user.getUserContact()); // It should be there, so run some tests on it - assert (user instanceof User) : "Instance loginController.loggedInUser is null"; - assert (user.getUserId() instanceof Long) : "Instance loginController.loggedInUser.userId is null"; - assert (user.getUserId() > 0) : MessageFormat.format("loginController.loggedInUser.userId={0} is invalid", user.getUserId()); - assert (user.getUserContact() instanceof Contact) : "Instance loginController.loggedInUser.userContact is null"; - assert (user.getUserContact().getContactId() instanceof Long) : "Instance loginController.userContact.contactId is null"; - assert (user.getUserContact().getContactId() > 0) : MessageFormat.format("Instance loginController.userContact.contactId={0} is invalid", user.getUserContact().getContactId()); + assert (user instanceof User) : "Instance userLoginController.loggedInUser is null"; + assert (user.getUserId() instanceof Long) : "Instance userLoginController.loggedInUser.userId is null"; + assert (user.getUserId() > 0) : MessageFormat.format("userLoginController.loggedInUser.userId={0} is invalid", user.getUserId()); + assert (user.getUserContact() instanceof Contact) : "Instance userLoginController.loggedInUser.userContact is null"; + assert (user.getUserContact().getContactId() instanceof Long) : "Instance userLoginController.userContact.contactId is null"; + assert (user.getUserContact().getContactId() > 0) : MessageFormat.format("Instance userLoginController.userContact.contactId={0} is invalid", user.getUserContact().getContactId()); // Update all fields user.setUserProfileMode(this.getUserProfileMode()); diff --git a/src/java/org/mxchange/jfinancials/validator/password/FinancialsUserPasswordValidator.java b/src/java/org/mxchange/jfinancials/validator/password/FinancialsUserPasswordValidator.java index dc1a130a..9a5e4699 100644 --- a/src/java/org/mxchange/jfinancials/validator/password/FinancialsUserPasswordValidator.java +++ b/src/java/org/mxchange/jfinancials/validator/password/FinancialsUserPasswordValidator.java @@ -46,7 +46,7 @@ public class FinancialsUserPasswordValidator extends BaseStringValidator impleme * User login controller */ @Inject - private FinancialsUserLoginWebSessionController loginController; + private FinancialsUserLoginWebSessionController userLoginController; @Override public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException { @@ -60,10 +60,10 @@ public class FinancialsUserPasswordValidator extends BaseStringValidator impleme super.preValidate(context, component, value, requiredFields, false); // value is known to be an entered password, so instance login container - LoginContainer container = new UserLoginContainer(this.loginController.getLoggedInUser(), (String) value); + LoginContainer container = new UserLoginContainer(this.userLoginController.getLoggedInUser(), (String) value); // Test it here - if (!UserUtils.ifPasswordMatches(container, this.loginController.getLoggedInUser())) { + if (!UserUtils.ifPasswordMatches(container, this.userLoginController.getLoggedInUser())) { // Password mismatches throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Password mismatching.", "The password the user has entered does not match the stored password.")); //NOI18N } -- 2.39.5