Class PasswordRecoveryServiceImpl
java.lang.Object
org.exoplatform.web.login.recovery.PasswordRecoveryServiceImpl
- All Implemented Interfaces:
org.exoplatform.web.login.recovery.PasswordRecoveryService
public class PasswordRecoveryServiceImpl
extends Object
implements org.exoplatform.web.login.recovery.PasswordRecoveryService
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPasswordRecoveryServiceImpl(org.exoplatform.container.xml.InitParams initParams, org.exoplatform.services.organization.OrganizationService orgService, org.exoplatform.services.mail.MailService mailService, org.exoplatform.services.resources.ResourceBundleService bundleService, RemindPasswordTokenService remindPasswordTokenService, OnboardingTokenService onboardingTokenService, CookieTokenService cookieTokenService, org.exoplatform.web.WebAppController controller, org.exoplatform.portal.branding.BrandingService brandingService) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConnector(org.exoplatform.web.login.recovery.ChangePasswordConnector connector) booleanallowChangePassword(String username) protected StringbuildOnboardingEmailBody(org.exoplatform.services.organization.User user, ResourceBundle bundle, String link, String message, long validityMillis) Builds the onboarding email from its template: the administrator's message, HTML its caller has sanitized, is inserted as is above the link, and the link's validity is written in days when it is a whole number of days from two up, in whole hours otherwiseprotected static StringbuildOnboardingMessageBlock(String message) The message block of the onboarding email: the administrator's message as its caller hands it, HTML the caller has sanitized (the editor's markup, scripts and attributes removed), nothing when it is blank.protected static StringbuildValidityLabel(ResourceBundle bundle, long validityMillis) The validity of a link as the email states it: in days when it is a whole number of days from two up, in whole hours otherwise (a day reads "24 hours")booleanchangePass(String tokenId, String tokenType, String username, String password) voiddeleteToken(String tokenId, String type) protected static StringfillTemplate(String template, Map<String, String> values) Fills every placeholder of the template in one pass: a value holding a placeholder's form stays text, and a placeholder with no value is removedorg.exoplatform.web.login.recovery.ChangePasswordConnectorprotected StringgetEmailSubject(org.exoplatform.services.organization.User user, ResourceBundle bundle) getExternalRegistrationURL(String tokenId, String lang) longgetOnboardingURL(String tokenId, String lang) getPasswordRecoverURL(String tokenId, String lang) protected static booleanisWholeDays(long validityMillis) booleansendAccountCreatedConfirmationEmail(String username, Locale locale, StringBuilder url) booleansendAccountVerificationEmail(String data, String username, String firstName, String lastName, String email, Locale locale, StringBuilder url) sendExternalRegisterEmail(String sender, String email, Locale locale, String space, StringBuilder url) sendExternalRegisterEmail(String sender, String email, Locale locale, String space, StringBuilder url, boolean spaceInvitation) sendExternalRegisterEmail(String sender, String email, Locale locale, String space, StringBuilder url, boolean spaceInvitation, String initialUri) booleansendOnboardingEmail(org.exoplatform.services.organization.User user, Locale locale, StringBuilder url) booleansendOnboardingEmail(org.exoplatform.services.organization.User user, Locale locale, StringBuilder url, String message) booleansendRecoverPasswordEmail(org.exoplatform.services.organization.User user, Locale defaultLocale, jakarta.servlet.http.HttpServletRequest req) verifyToken(String tokenId) verifyToken(String tokenId, String type)
-
Field Details
-
AUTHENTICATION_ATTEMPTS
- See Also:
-
TOKEN
public static final org.exoplatform.web.controller.QualifiedName TOKEN -
LANG
public static final org.exoplatform.web.controller.QualifiedName LANG -
NAME
- See Also:
-
log
protected static org.exoplatform.services.log.Log log -
CONFIGURED_DOMAIN_URL_KEY
- See Also:
-
-
Constructor Details
-
PasswordRecoveryServiceImpl
public PasswordRecoveryServiceImpl(org.exoplatform.container.xml.InitParams initParams, org.exoplatform.services.organization.OrganizationService orgService, org.exoplatform.services.mail.MailService mailService, org.exoplatform.services.resources.ResourceBundleService bundleService, RemindPasswordTokenService remindPasswordTokenService, OnboardingTokenService onboardingTokenService, CookieTokenService cookieTokenService, org.exoplatform.web.WebAppController controller, org.exoplatform.portal.branding.BrandingService brandingService)
-
-
Method Details
-
addConnector
public void addConnector(org.exoplatform.web.login.recovery.ChangePasswordConnector connector) - Specified by:
addConnectorin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService
-
verifyToken
- Specified by:
verifyTokenin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService
-
deleteToken
- Specified by:
deleteTokenin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService
-
getOnboardingTokenValidity
public long getOnboardingTokenValidity()- Specified by:
getOnboardingTokenValidityin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService
-
verifyToken
- Specified by:
verifyTokenin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService
-
allowChangePassword
- Specified by:
allowChangePasswordin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService- Throws:
Exception
-
changePass
- Specified by:
changePassin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService
-
sendOnboardingEmail
public boolean sendOnboardingEmail(org.exoplatform.services.organization.User user, Locale locale, StringBuilder url) - Specified by:
sendOnboardingEmailin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService
-
sendOnboardingEmail
public boolean sendOnboardingEmail(org.exoplatform.services.organization.User user, Locale locale, StringBuilder url, String message) - Specified by:
sendOnboardingEmailin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService
-
buildOnboardingEmailBody
protected String buildOnboardingEmailBody(org.exoplatform.services.organization.User user, ResourceBundle bundle, String link, String message, long validityMillis) Builds the onboarding email from its template: the administrator's message, HTML its caller has sanitized, is inserted as is above the link, and the link's validity is written in days when it is a whole number of days from two up, in whole hours otherwise -
buildOnboardingMessageBlock
The message block of the onboarding email: the administrator's message as its caller hands it, HTML the caller has sanitized (the editor's markup, scripts and attributes removed), nothing when it is blank. The block is inserted by the one-pass fill, so a placeholder form inside the message stays text. -
buildValidityLabel
The validity of a link as the email states it: in days when it is a whole number of days from two up, in whole hours otherwise (a day reads "24 hours") -
isWholeDays
protected static boolean isWholeDays(long validityMillis) - Parameters:
validityMillis- a validity in milliseconds- Returns:
- true when the validity is stated in days: a whole number of days, from two up
-
fillTemplate
Fills every placeholder of the template in one pass: a value holding a placeholder's form stays text, and a placeholder with no value is removed -
sendExternalRegisterEmail
public String sendExternalRegisterEmail(String sender, String email, Locale locale, String space, StringBuilder url) throws Exception - Specified by:
sendExternalRegisterEmailin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService- Throws:
Exception
-
sendExternalRegisterEmail
public String sendExternalRegisterEmail(String sender, String email, Locale locale, String space, StringBuilder url, boolean spaceInvitation) throws Exception - Specified by:
sendExternalRegisterEmailin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService- Throws:
Exception
-
sendExternalRegisterEmail
public String sendExternalRegisterEmail(String sender, String email, Locale locale, String space, StringBuilder url, boolean spaceInvitation, String initialUri) throws Exception - Specified by:
sendExternalRegisterEmailin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService- Throws:
Exception
-
sendAccountVerificationEmail
public boolean sendAccountVerificationEmail(String data, String username, String firstName, String lastName, String email, Locale locale, StringBuilder url) - Specified by:
sendAccountVerificationEmailin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService
-
sendAccountCreatedConfirmationEmail
public boolean sendAccountCreatedConfirmationEmail(String username, Locale locale, StringBuilder url) - Specified by:
sendAccountCreatedConfirmationEmailin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService
-
sendRecoverPasswordEmail
public boolean sendRecoverPasswordEmail(org.exoplatform.services.organization.User user, Locale defaultLocale, jakarta.servlet.http.HttpServletRequest req) - Specified by:
sendRecoverPasswordEmailin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService
-
getEmailSubject
protected String getEmailSubject(org.exoplatform.services.organization.User user, ResourceBundle bundle) -
getOnboardingURL
- Specified by:
getOnboardingURLin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService
-
getExternalRegistrationURL
- Specified by:
getExternalRegistrationURLin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService
-
getPasswordRecoverURL
- Specified by:
getPasswordRecoverURLin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService
-
getActiveChangePasswordConnector
public org.exoplatform.web.login.recovery.ChangePasswordConnector getActiveChangePasswordConnector()- Specified by:
getActiveChangePasswordConnectorin interfaceorg.exoplatform.web.login.recovery.PasswordRecoveryService
-