Package org.ametys.web.usermanagement
Class UserSignupManager
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.datasource.AbstractMyBatisDAO
org.ametys.web.usermanagement.UserSignupManager
- All Implemented Interfaces:
LogEnabled
,PluginAware
,Component
,Configurable
,Contextualizable
,Serviceable
- Direct Known Subclasses:
UserSignupManager
Manages registration and password recovery of users.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enumeration for the different type of signupstatic class
Bean representing a user sign-up request. -
Field Summary
Modifier and TypeFieldDescriptionprotected CurrentUserProvider
The current user providerprotected I18nUtils
The i18n utils.protected PopulationContextHelper
The population context helper.protected String
The password change table.protected RenderingContextHandler
The rendering context handlerprotected AmetysObjectResolver
The ametys object resolver.protected RightManager
The right managerprotected SiteConfigurationExtensionPoint
The site configuration extension point.protected SiteManager
The site manager.protected String
The temporary users table.protected UserDirectoryFactory
factory for user directory modelsprotected UserManager
The user manager.protected UserPopulationDAO
The DAO for user populationsprotected UserSignUpConfiguration
The user sign up configurationstatic final String
Id of service for signup pagesstatic final String
Tag for password pagesstatic final String
The component role.static final String
Id of service for signup pagesstatic final String
Tag for signup pagesstatic final String
The Signup Service parameter : userDirectorystatic final String
The site parameter name for signup typeFields inherited from class org.ametys.core.datasource.AbstractMyBatisDAO
_manager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
additionalSignupOperations
(User createdUser, Multimap<String, I18nizableText> errors) Process additional operations after creation of uservoid
addPasswordToken
(String siteName, String login, String token, String population) Create a user password change request in the database.protected void
addTemporaryUser
(String siteName, String email, String token, String population, String userDirectoryId, String lastname, String firstname, UserSignupManager.TempUser.TempUserOrigin origin) Create a user sign-up request ("temporary" user) in the database.void
changeUserPassword
(String siteName, String login, String token, String newPassword, String population) Change the user password.void
checkPasswordToken
(String siteName, String login, String token, String population) Check the password change request token.protected void
checkPublicSignup
(String siteName) Verify that public sign-up is allowed.protected void
checkSignupAllowed
(String siteName) Verify that public sign-up is allowed.void
Check the sign-up request token.protected void
checkUserAllowedForInvitation
(String siteName, String populationId) Verify that current user is allowed to handle invitation for a given populationvoid
configure
(Configuration configuration) getAllowedUserPopulationForInvitation
(String siteName) Get the ids of user populations the current user can handle for invitationgetGTUContent
(ZoneItem zoneItem) Get the GTU content Returns null if not found or emptygetGTUPage
(ZoneItem zoneItem) Get the GTU page Returns null if not found or emptygetOrCreateToken
(String siteName, String language, String email, String population, String userDirectoryId) Temporary sign the user in and returns the tokengetPwdChangePage
(String siteName, String language) Get the password change page in a given site and sitemap.getPwdChangePages
(String siteName, String language) Get all the pages tagged "password change".getResetPasswordUri
(Page passwordPage, String login, String population, String token, boolean absolute) Get the URI to reset a passwordgetSignupPage
(String siteName, String language) Get the sign-up page in a given site and sitemap.
If more than one page are tagged "sign-up", return the first.getSignupPage
(String siteName, String language, String populationId, String userDirectoryId) Get the sign-up page in a given site and sitemap, configured for given population and user directory.
If more than one page are tagged "sign-up", return the first.getSignupPages
(String siteName, String language) Get all the pages tagged "sign-up" with signup servicegetSignupPages
(String siteName, String language, String populationId, String userDirectoryId) Get all the pages tagged "sign-up" with signup service configured for given population and user directorygetSignupType
(String siteName) Get the type of signup authorized for this sitegetSuccessContent
(ZoneItem zoneItem) Get the success content Returns null if not found or emptygetSuccessPage
(ZoneItem zoneItem) Get the GTU page Returns null if not found or emptyprotected UserSignupManager.TempUser
getTempUser
(String siteName, String email, String population, String userDirectoryId) Get a temporary user from his site name and e-mail.protected UserSignupManager.TempUser
Get a temporary user from his site name, e-mail and/or token.getTempUsers
(String siteName, Map<String, Object> searchParameters, int offset, int limit, List<Map<String, String>> sorts) Get the temporary users from a given site matching the search parametersgetTempUsersProperties
(List<String> emails, String siteName) Get temporary users propertiesGet a token for temp userint
getTotalCount
(String siteName, Map<String, Object> searchParameters) Get the number of temporary users matching the search parametersgetUserDirectory
(ZoneItem zoneItem) Get the user directorygetUserIfHeExists
(String email, String siteName) Get the user from email if he/she exists in the populationsvoid
inviteToSignup
(String siteName, String language, String email, String population, String userDirectoryId, String lastname, String firstname) Validate and store a invitation to sign-up request and send a confirmation e-mail.void
inviteToSignup
(String siteName, String language, String email, String population, String userDirectoryId, String lastname, String firstname, boolean sendMail, boolean resendInvitationIfExists, boolean checkRights) Validate and store a invitation to sign-up request and send a confirmation e-mail.boolean
isPublicSignupAllowed
(String siteName) Test if public signup is allowed in a site.boolean
isPwdChangePage
(Page page) Check if page is a change password pageboolean
isSignupAllowed
(String siteName) Test if signup is allowed in a site, public or on invitationboolean
isSignupPage
(Page page) Check if page is a signup pagevoid
Remove the expired change password request tokens.void
Remove the expired sign-up request tokens (user request only)int
removeExpiredTokens
(String siteName) Remove the expired sign-up request tokens (user request only)protected void
removePasswordToken
(String siteName, String login, String token, String population) Remove the password change request.protected void
removeTempUser
(String siteName, String email, String token, String population, String userDirectoryId) Remove the temporary .void
resendInvitation
(String siteName, String email, String population, String userDirectoryId) Update susbcription date and resend an invitationvoid
resetPassword
(String siteName, String language, String loginOrEmail, String populationId) Create a reset password request and send a confirmation e-mail.void
resetTempSignup
(String siteName, String language, String email, String population, String userDirectoryId) Reset a sign-up request: generate a new token and re-send the confirmation e-mail.protected void
resetTempSignup
(String siteName, String language, String email, String token, String population, String userDirectoryId) Reset a sign-up request: generate a new token and re-send the confirmation e-mail.searchTempUsers
(String siteName, Map<String, Object> searchParameters, int offset, int limit, List<Map<String, String>> sorts) Get the temporary users from a given site matching the search parametersprotected void
sendResetPasswordMail
(String siteName, String language, User user, String token) Send a sign-up confirmation link by e-mail.protected void
sendSignupConfirmMail
(UserSignupManager.TempUser tempUser, String language) Send a sign-up confirmation link by e-mail.protected void
sendSignupValidatedMail
(String siteName, String language, User user) Send a sign-up confirmation link by e-mail.void
service
(ServiceManager serviceManager) void
signup
(String siteName, String language, String firstname, String lastname, String email, String token, String password, String population, String userDirectoryId, Multimap<String, I18nizableText> errors) Create the user in the FO UsersManager from his temporary request.void
temporarySignup
(String siteName, String language, String email, String population, String userDirectoryId) Validate and store a sign-up request and send a confirmation e-mail.void
temporarySignup
(String siteName, String language, String email, String population, String userDirectoryId, boolean sendMail) Validate and store a sign-up request and send a confirmation e-mail.protected void
updateTempToken
(String siteName, String email, String newToken, String population, String userDirectoryId) Update the sign-up request token: reset the date and set a new token.boolean
userExists
(String email, String siteName) Tests if the user already exists in the populationsValidate the user subscription data.validatePassword
(String siteName, String password, String login, String population) Validate the user password.void
Do some validation before signupMethods inherited from class org.ametys.core.datasource.AbstractMyBatisDAO
_configureDatasource, _getDataSourceId, _getMyBatisConfiguration, contextualize, getSession, getSession, reload, setPluginInfo
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The component role. -
SITE_PARAM_SIGNUP_TYPE
The site parameter name for signup type- See Also:
-
SIGNUP_SERVICE_PARAMETER_USERDIRECTORY
The Signup Service parameter : userDirectory- See Also:
-
SIGNUP_PAGE_TAG_NAME
Tag for signup pages- See Also:
-
SIGNUP_PAGE_SERVICE_ID
Id of service for signup pages- See Also:
-
CHANGE_PASSWORD_PAGE_TAG_NAME
Tag for password pages- See Also:
-
CHANGE_PASSWORD_PAGE_SERVICE_ID
Id of service for signup pages- See Also:
-
_userManager
The user manager. -
_userPopulationDAO
The DAO for user populations -
_siteManager
The site manager. -
_siteConf
The site configuration extension point. -
_resolver
The ametys object resolver. -
_i18nUtils
The i18n utils. -
_userSignUpConfiguration
The user sign up configuration -
_tempUsersTable
The temporary users table. -
_pwdChangeTable
The password change table. -
_populationContextHelper
The population context helper. -
_renderingContextHandler
The rendering context handler -
_userDirectoryFactory
factory for user directory models -
_currentUserProvider
The current user provider -
_rightManager
The right manager
-
-
Constructor Details
-
UserSignupManager
public UserSignupManager()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractMyBatisDAO
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Overrides:
configure
in classAbstractMyBatisDAO
- Throws:
ConfigurationException
-
getSignupType
Get the type of signup authorized for this site- Parameters:
siteName
- the site name- Returns:
- the of signup
-
isPublicSignupAllowed
Test if public signup is allowed in a site.- Parameters:
siteName
- the site to test.- Returns:
- true if public signup is allowed, false otherwise.
-
isSignupAllowed
Test if signup is allowed in a site, public or on invitation- Parameters:
siteName
- the site to test.- Returns:
- true if signup is allowed, false otherwise.
-
getSignupPage
Get the sign-up page in a given site and sitemap.
If more than one page are tagged "sign-up", return the first.- Parameters:
siteName
- the site name.language
- the sitemap name.- Returns:
- the sign-up page or null if not found.
-
getSignupPage
public Page getSignupPage(String siteName, String language, String populationId, String userDirectoryId) Get the sign-up page in a given site and sitemap, configured for given population and user directory.
If more than one page are tagged "sign-up", return the first.- Parameters:
siteName
- the site name.language
- the sitemap name.populationId
- The population id. Can be null to not check population.userDirectoryId
- The user directory id. Can be null to not check user directory.- Returns:
- the sign-up page or null if not found.
-
isSignupPage
Check if page is a signup page- Parameters:
page
- the page- Returns:
- true if the page contains the signup service
-
getSignupPages
Get all the pages tagged "sign-up" with signup service- Parameters:
siteName
- the site name.language
- the sitemap name.- Returns:
- an iterable on all the pages tagged "sign-up".
-
getSignupPages
public List<Page> getSignupPages(String siteName, String language, String populationId, String userDirectoryId) Get all the pages tagged "sign-up" with signup service configured for given population and user directory- Parameters:
siteName
- the site name.language
- the sitemap name.populationId
- The population id. Can be null to not check population.userDirectoryId
- The user directory id. Can be null to not check user directory.- Returns:
- an iterable on all the pages tagged "sign-up".
-
getPwdChangePage
Get the password change page in a given site and sitemap. If more than one page are tagged "password change", return the first.- Parameters:
siteName
- the site name.language
- the sitemap name.- Returns:
- the password change page or null if not found.
-
getGTUPage
Get the GTU page Returns null if not found or empty- Parameters:
zoneItem
- the zone item- Returns:
- the GTU page or null.
-
getUserDirectory
Get the user directory- Parameters:
zoneItem
- the zone item with signup service- Returns:
- The user directory or null if not found
-
getGTUContent
Get the GTU content Returns null if not found or empty- Parameters:
zoneItem
- the zone item- Returns:
- the GTU content or null.
-
getSuccessPage
Get the GTU page Returns null if not found or empty- Parameters:
zoneItem
- the zone item- Returns:
- the success page or null.
-
getSuccessContent
Get the success content Returns null if not found or empty- Parameters:
zoneItem
- the zone item- Returns:
- the success content or null.
-
getPwdChangePages
Get all the pages tagged "password change".- Parameters:
siteName
- the site name.language
- the sitemap name.- Returns:
- an iterable on all the pages tagged "password change".
-
isPwdChangePage
Check if page is a change password page- Parameters:
page
- the page- Returns:
- true if the page contains the change password service
-
getUserIfHeExists
public Optional<User> getUserIfHeExists(String email, String siteName) throws UserManagementException, NotUniqueUserException Get the user from email if he/she exists in the populations- Parameters:
email
- the e-mail to test.siteName
- The site name- Returns:
- the user if the user exists, empty otherwise.
- Throws:
UserManagementException
- if an error occurs.NotUniqueUserException
- if several user respond to the email
-
userExists
Tests if the user already exists in the populations- Parameters:
email
- the e-mail to test.siteName
- The site name- Returns:
- true if the user exists, false otherwise.
- Throws:
UserManagementException
- if an error occurs.
-
validate
public Map<String,List<I18nizableText>> validate(String siteName, String email, Map<String, String> additionalValues) throws UserManagementExceptionValidate the user subscription data.- Parameters:
siteName
- the site name.email
- the user e-mail.additionalValues
- the additional user values.- Returns:
- a Map of the Errors by field.
- Throws:
UserManagementException
- if an error occurs.
-
validatePassword
public List<I18nizableText> validatePassword(String siteName, String password, String login, String population) throws UserManagementException Validate the user password.- Parameters:
siteName
- the site name.password
- the password to validate.login
- the login of the userpopulation
- The id of the population- Returns:
- a Map of the Errors by field.
- Throws:
UserManagementException
- if an error occurs.
-
getOrCreateToken
public String getOrCreateToken(String siteName, String language, String email, String population, String userDirectoryId) throws UserManagementException Temporary sign the user in and returns the token- Parameters:
siteName
- The site's namelanguage
- The page's languageemail
- The email of the userpopulation
- The population IDuserDirectoryId
- The userDirectory ID- Returns:
- The sign-up token
- Throws:
UserManagementException
- If an error occurs
-
temporarySignup
public void temporarySignup(String siteName, String language, String email, String population, String userDirectoryId) throws UserManagementException Validate and store a sign-up request and send a confirmation e-mail.- Parameters:
siteName
- the site name.language
- the sitemap name.email
- the user e-mail address.population
- the populationuserDirectoryId
- the id of the user directory of the population- Throws:
UserManagementException
- if an error occurs.
-
temporarySignup
public void temporarySignup(String siteName, String language, String email, String population, String userDirectoryId, boolean sendMail) throws UserManagementException Validate and store a sign-up request and send a confirmation e-mail.- Parameters:
siteName
- the site name.language
- the sitemap name.email
- the user e-mail address.population
- the populationuserDirectoryId
- the id of the user directory of the populationsendMail
- Set to false to not send mail at end of process- Throws:
UserManagementException
- if an error occurs.
-
inviteToSignup
public void inviteToSignup(String siteName, String language, String email, String population, String userDirectoryId, String lastname, String firstname) throws UserManagementException Validate and store a invitation to sign-up request and send a confirmation e-mail.- Parameters:
siteName
- the site name.language
- the sitemap name.email
- the user e-mail address.population
- the populationuserDirectoryId
- the id of the user directory of the populationlastname
- The guest last name. Can be null.firstname
- The guest first name. Can be null.- Throws:
UserManagementException
- if an error occurs.
-
inviteToSignup
public void inviteToSignup(String siteName, String language, String email, String population, String userDirectoryId, String lastname, String firstname, boolean sendMail, boolean resendInvitationIfExists, boolean checkRights) throws UserManagementException Validate and store a invitation to sign-up request and send a confirmation e-mail.- Parameters:
siteName
- the site name.language
- the sitemap name.email
- the user e-mail address.population
- the populationuserDirectoryId
- the id of the user directory of the populationlastname
- The guest last name. Can be null.firstname
- The guest first name. Can be null.sendMail
- Set to false to not send mail at end of processresendInvitationIfExists
- Set to false to not resend invitation if the email already exists as a user waiting signupcheckRights
- set to false to ignore rights- Throws:
UserManagementException
- if an error occurs.
-
getToken
public String getToken(String siteName, String email, String population, String userDirectoryId) throws UserManagementException Get a token for temp user- Parameters:
siteName
- the site name.email
- the user e-mail address.population
- The id of the populationuserDirectoryId
- The id of the user directory of the population- Returns:
- the user token or null if not found
- Throws:
UserManagementException
- if an error occurs.
-
resendInvitation
public void resendInvitation(String siteName, String email, String population, String userDirectoryId) throws UserManagementException Update susbcription date and resend an invitation- Parameters:
siteName
- the site nameemail
- the emailpopulation
- the population iduserDirectoryId
- the user directory id- Throws:
UserManagementException
- if an error occurred
-
resetTempSignup
public void resetTempSignup(String siteName, String language, String email, String population, String userDirectoryId) throws UserManagementException Reset a sign-up request: generate a new token and re-send the confirmation e-mail.- Parameters:
siteName
- the site name.language
- the sitemap name.email
- the user e-mail address.population
- The id of the populationuserDirectoryId
- The id of the user directory of the population- Throws:
UserManagementException
- if an error occurs.
-
resetTempSignup
protected void resetTempSignup(String siteName, String language, String email, String token, String population, String userDirectoryId) throws UserManagementException Reset a sign-up request: generate a new token and re-send the confirmation e-mail.- Parameters:
siteName
- the site name.language
- the sitemap name.email
- the user e-mail address.token
- the token. Can be null to not re-generate token.population
- The id of the populationuserDirectoryId
- The id of the user directory of the population- Throws:
UserManagementException
- if an error occurs.
-
signup
public void signup(String siteName, String language, String firstname, String lastname, String email, String token, String password, String population, String userDirectoryId, Multimap<String, I18nizableText> errors) throws UserManagementExceptionCreate the user in the FO UsersManager from his temporary request.- Parameters:
siteName
- the site name.language
- the current languagefirstname
- the user firstnamelastname
- the user lastnameemail
- the user e-mail address.token
- the request token.password
- the user password.population
- The id of the populationuserDirectoryId
- The id of the user directory of the populationerrors
- the errors- Throws:
UserManagementException
- if an error occurs.
-
validationBeforeSignup
Do some validation before signup- Parameters:
errors
- the map of errors to fill in cause of errors during validation
-
additionalSignupOperations
public void additionalSignupOperations(User createdUser, Multimap<String, I18nizableText> errors) throws UserManagementExceptionProcess additional operations after creation of user- Parameters:
createdUser
- the created usererrors
- the map of errors to fill in case of errors during additional operations- Throws:
UserManagementException
- if an error occurs.
-
resetPassword
public void resetPassword(String siteName, String language, String loginOrEmail, String populationId) throws UserManagementException Create a reset password request and send a confirmation e-mail.- Parameters:
siteName
- the site name.language
- the sitemap name.loginOrEmail
- the user login or email.populationId
- the population- Throws:
UserManagementException
- if an error occurs.
-
changeUserPassword
public void changeUserPassword(String siteName, String login, String token, String newPassword, String population) throws UserManagementException Change the user password.- Parameters:
siteName
- the site name.login
- the user login.token
- the password change request token.newPassword
- the new password.population
- the population- Throws:
UserManagementException
- if an error occurs.
-
checkToken
public void checkToken(String siteName, String email, String token, String population, String userDirectoryId) throws UserManagementException Check the sign-up request token.- Parameters:
siteName
- the site name.email
- the user e-mail.token
- the sign-up request token.population
- The id of the populationuserDirectoryId
- The id of the user directory of the population- Throws:
UserManagementException
- if an error occurs.
-
checkPasswordToken
public void checkPasswordToken(String siteName, String login, String token, String population) throws UserManagementException Check the password change request token.- Parameters:
siteName
- the site name.login
- the user login.token
- the password change request token.population
- the population- Throws:
UserManagementException
- if an error occurs.
-
removeExpiredTokens
Remove the expired sign-up request tokens (user request only)- Throws:
UserManagementException
- if an error occurs.
-
removeExpiredTokens
Remove the expired sign-up request tokens (user request only)- Parameters:
siteName
- the site name. Can be null.- Returns:
- the number of deleted tokens
- Throws:
UserManagementException
- if an error occurs.
-
removeExpiredPasswordTokens
Remove the expired change password request tokens.- Throws:
UserManagementException
- if an error occurs.
-
checkPublicSignup
Verify that public sign-up is allowed. If not, throw an exception.- Parameters:
siteName
- the site name.- Throws:
UserManagementException
- if public sign-up is not enabled.
-
checkSignupAllowed
Verify that public sign-up is allowed. If not, throw an exception.- Parameters:
siteName
- the site name.- Throws:
UserManagementException
- if public sign-up is not enabled.
-
addTemporaryUser
protected void addTemporaryUser(String siteName, String email, String token, String population, String userDirectoryId, String lastname, String firstname, UserSignupManager.TempUser.TempUserOrigin origin) throws UserManagementException Create a user sign-up request ("temporary" user) in the database.- Parameters:
siteName
- the site name.email
- the user e-mail.token
- the generated token.population
- the populationuserDirectoryId
- the id of the user directory of the populationlastname
- The guest last name. Can be null.firstname
- The guest first name. Can be null.origin
- true if this signup request origin- Throws:
UserManagementException
- if an error occurs.
-
sendSignupConfirmMail
protected void sendSignupConfirmMail(UserSignupManager.TempUser tempUser, String language) throws UserManagementException Send a sign-up confirmation link by e-mail.- Parameters:
tempUser
- the temp userlanguage
- the e-mail language.- Throws:
UserManagementException
- if an error occurs.
-
sendSignupValidatedMail
protected void sendSignupValidatedMail(String siteName, String language, User user) throws UserManagementException Send a sign-up confirmation link by e-mail.- Parameters:
siteName
- the site name.language
- the e-mail language.user
- the created user- Throws:
UserManagementException
- if an error occurs.
-
updateTempToken
protected void updateTempToken(String siteName, String email, String newToken, String population, String userDirectoryId) throws UserManagementException Update the sign-up request token: reset the date and set a new token.- Parameters:
siteName
- the site name.email
- the user e-mail.newToken
- the new token.population
- The id of the populationuserDirectoryId
- The id of the user directory of the population- Throws:
UserManagementException
- if an error occurs.
-
addPasswordToken
public void addPasswordToken(String siteName, String login, String token, String population) throws UserManagementException Create a user password change request in the database.- Parameters:
siteName
- the site name.login
- the user login.token
- the generated token.population
- the population- Throws:
UserManagementException
- if an error occurs.
-
getTempUser
protected UserSignupManager.TempUser getTempUser(String siteName, String email, String population, String userDirectoryId) throws UserManagementException Get a temporary user from his site name and e-mail.- Parameters:
siteName
- the site name.email
- The temporary user e-mail. Cannot be null.population
- the populationuserDirectoryId
- the id of the user directory of the population- Returns:
- the temporary user or null if not found.
- Throws:
UserManagementException
- if an error occurs.
-
getTempUsersProperties
public Map<String,Object> getTempUsersProperties(List<String> emails, String siteName) throws UserManagementException Get temporary users properties- Parameters:
emails
- the emails of temporary userssiteName
- the site name of temporary users- Returns:
- The temporary users properties
- Throws:
UserManagementException
- if an error occurs.
-
searchTempUsers
public Map<String,Object> searchTempUsers(String siteName, Map<String, Object> searchParameters, int offset, int limit, List<Map<String, throws UserManagementExceptionString>> sorts) Get the temporary users from a given site matching the search parameters- Parameters:
siteName
- the site namesearchParameters
- the search parametersoffset
- index of the start of searchlimit
- the maximum number of resultssorts
- The sorters- Returns:
- the temporary users as JSON object
- Throws:
UserManagementException
- if an error occurs.
-
checkUserAllowedForInvitation
protected void checkUserAllowedForInvitation(String siteName, String populationId) throws UserManagementException Verify that current user is allowed to handle invitation for a given population- Parameters:
siteName
- the site name.populationId
- The population id- Throws:
UserManagementException
- if user is not allowed
-
getAllowedUserPopulationForInvitation
Get the ids of user populations the current user can handle for invitation- Parameters:
siteName
- the site name- Returns:
- the ids of user populations handled by current users
-
getTempUsers
public List<UserSignupManager.TempUser> getTempUsers(String siteName, Map<String, Object> searchParameters, int offset, int limit, List<Map<String, throws UserManagementExceptionString>> sorts) Get the temporary users from a given site matching the search parameters- Parameters:
siteName
- the site name. Can not be nullsearchParameters
- The search parametersoffset
- index of the start of searchlimit
- the maximum number of resultssorts
- The sorters. Can be null or empty- Returns:
- the temporary users
- Throws:
UserManagementException
- if an error occurs.
-
getTotalCount
public int getTotalCount(String siteName, Map<String, Object> searchParameters) throws UserManagementExceptionGet the number of temporary users matching the search parameters- Parameters:
siteName
- the site name. Can not be nullsearchParameters
- The search parameters- Returns:
- the total number of results
- Throws:
UserManagementException
- if an error occurs.
-
getTempUser
protected UserSignupManager.TempUser getTempUser(String siteName, String email, String token, String population, String userDirectoryId) throws UserManagementException Get a temporary user from his site name, e-mail and/or token. At least one of e-mail and token must be provided.- Parameters:
siteName
- the site name.email
- The temporary user e-mail. Can be null.token
- The temporary user token. Can be null.population
- the population. Must be not null if email is not nulluserDirectoryId
- the id of the user directory of the population. Must be not null if email is not null- Returns:
- the temporary user or null if not found.
- Throws:
UserManagementException
- if an error occurs.
-
removeTempUser
protected void removeTempUser(String siteName, String email, String token, String population, String userDirectoryId) throws UserManagementException Remove the temporary .- Parameters:
siteName
- the site name.email
- the user e-mail address.token
- the request token.population
- the populationuserDirectoryId
- the id of the user directory of the population- Throws:
UserManagementException
- if an error occurs.
-
removePasswordToken
protected void removePasswordToken(String siteName, String login, String token, String population) throws UserManagementException Remove the password change request.- Parameters:
siteName
- the site name.login
- the user login.token
- the request token.population
- the population- Throws:
UserManagementException
- if an error occurs.
-
sendResetPasswordMail
protected void sendResetPasswordMail(String siteName, String language, User user, String token) throws UserManagementException Send a sign-up confirmation link by e-mail.- Parameters:
siteName
- the site name.language
- the e-mail language.user
- the user object.token
- the generated token.- Throws:
UserManagementException
- if an error occurs.
-
getResetPasswordUri
public String getResetPasswordUri(Page passwordPage, String login, String population, String token, boolean absolute) Get the URI to reset a password- Parameters:
passwordPage
- The passwodr page. Can not be null.login
- the user loginpopulation
- the user populationtoken
- the generated tokenabsolute
- true to get absolute uri- Returns:
- the computed uri
-