private void ensureCredentialsMatch(String email, String password) { UserCredentialsMatcher matcher = new UserCredentialsMatcher(database); UserEmailAddressEntity emailEntity = addressDAO.getPrimaryEmail(emailDAO.getUserByEmail(email)); UserAuthenticationInfo authinfo = UserAuthenticationInfo.createInfoFromEntity(emailEntity); UsernamePasswordToken token = new UsernamePasswordToken(email, password); assertTrue(matcher.doCredentialsMatch(token, authinfo)); }
@CommitAfter public Object onSuccessFromPasswordForm() throws IOException, HornetQException { user.createPassword(newPassword); passwordChanged = true; emailNotify.startMessage(EmailTemplate.USER_CHANGE_PASSWORD); emailNotify.setToAddress(userEmailAddressDAO.getPrimaryEmail(user).getEmail()); emailNotify.send(); return this; }
public Object onActivate() throws AxirassaSecurityException { user = security.getUserEntity(); phoneNumbers = userPhoneNumberDAO.getPhoneNumbersByUser(user); if (phoneNumbers.isEmpty()) hasPhoneNumbers = false; else hasPhoneNumbers = true; emails = userEmailAddressDAO.getEmailsByUser(user); if (emails.isEmpty()) hasAlternateEmails = false; else hasAlternateEmails = true; return true; }