if (email == null) {
log.error("Email attribute was not found in attributes");
return "Email address was not found in response " + MartinlawConstants.OPENID_ERROR_MSG_INDICATOR;
} else {
EntityContract entity = getEntityInfoService().getEntityByEmail(email);
if (entity == null) {
return "Email address '" + email + "' is not associated with an existing user"
+ MartinlawConstants.OPENID_ERROR_MSG_INDICATOR;
} else if (!hasEmploymentAffiliation(entity)) {
return "You are not affiliated as a staff :(";
} else if (!entity.isActive()) {
return "Your account is not active :(";
} else {
if (emailSetupOk()) {
String fromAddr = getParameterService().getParameterValueAsString(
KewApiConstants.KEW_NAMESPACE, "Mailer", KewApiConstants.EMAIL_REMINDER_FROM_ADDRESS);
createAndEmailActivation(email, token.getIdentityUrl(), entity, fromAddr);
return entity.getDefaultName().getFirstName() +
", an activation email has been sent to '" + email + "' from address '" + fromAddr
+ "'. If none comes to your inbox or spam folder after a few minutes, please contact support";
} else {
return "An activation email could not be sent to '" + email +
"' due to a missing email configuration" + MartinlawConstants.OPENID_ERROR_MSG_INDICATOR;