Package com.atlassian.confluence.user
Class DefaultSignupManager
java.lang.Object
com.atlassian.confluence.user.DefaultSignupManager
- All Implemented Interfaces:
SignupManager
Handles easy-user creation in its myriad forms.
- Since:
- 4.1
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultSignupManager
(com.atlassian.bandana.BandanaManager bandanaManager, com.atlassian.security.random.SecureTokenGenerator secureTokenGenerator, UserVerificationTokenManager userVerificationTokenManager, com.atlassian.crowd.embedded.api.CrowdService crowdService, SettingsManager settingsManager, com.atlassian.renderer.WikiStyleRenderer wikiStyleRenderer, EmailService notificationsService, NotificationsSender notificationsSender, com.atlassian.event.api.EventPublisher eventPublisher, UserChecker userChecker, PersonalInformationManager personalInformationManager, com.atlassian.core.task.MultiQueueTaskManager taskManager, I18NBeanFactory i18NBeanFactory, DataSourceFactory dataSourceFactory) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canSignUpWith
(String token) Return true if the given token is valid for a user to self-sign-up.createUserPendingConfirmation
(com.atlassian.user.User user, String password) Creates a new user and marks them disabled pending their email confirmation?boolean
doesUserHaveOutdatedSignupToken
(com.atlassian.user.User user) void
enableConfirmedUser
(com.atlassian.user.User user) Enable previously disabled user who signed up and confirmed their email.Returns comma separated list of domains.Gets the current sign-up token, or creates a new one and returns it.boolean
boolean
isEmailOnRestrictedDomain
(String email) Checks if the given email address is on one of the configured restricted domains.boolean
boolean
isPendingConfirmation
(com.atlassian.user.User user) Is given user tried to sign up but hasn't confirmed their email yet?boolean
Returns true if users can sign themselves for this instance.boolean
isTokenForUserValid
(com.atlassian.user.User user, String token) Creates a new sign-up token and returns it.Restore the previous private-signup token and returns it.void
sendConfirmationEmail
(String token, com.atlassian.user.User user) Sends a confirmation email to the given new user.sendInvites
(SendUserInviteEvent event) Send invitation emails with a message to a list of email addresses.void
Sends a welcome email to the given new user.void
setDomainRestrictedSignupMode
(String allowedDomains) Set the domains that user's email address should belong to to be able to sign up.void
setEmailSentOnInviteSignUp
(boolean notify) void
void
-
Field Details
-
SIGNUP_TOKEN
- See Also:
-
PREVIOUS_SIGNUP_TOKEN
- See Also:
-
NOTIFY_ON_SIGNUP_TOKEN
- See Also:
-
-
Constructor Details
-
DefaultSignupManager
public DefaultSignupManager(com.atlassian.bandana.BandanaManager bandanaManager, com.atlassian.security.random.SecureTokenGenerator secureTokenGenerator, UserVerificationTokenManager userVerificationTokenManager, com.atlassian.crowd.embedded.api.CrowdService crowdService, SettingsManager settingsManager, com.atlassian.renderer.WikiStyleRenderer wikiStyleRenderer, EmailService notificationsService, NotificationsSender notificationsSender, com.atlassian.event.api.EventPublisher eventPublisher, UserChecker userChecker, PersonalInformationManager personalInformationManager, com.atlassian.core.task.MultiQueueTaskManager taskManager, I18NBeanFactory i18NBeanFactory, DataSourceFactory dataSourceFactory) - Since:
- 7.17
-
-
Method Details
-
refreshAndGetToken
Description copied from interface:SignupManager
Creates a new sign-up token and returns it. This invalidates the previous token.- Specified by:
refreshAndGetToken
in interfaceSignupManager
- Returns:
- a random sign-up token
-
canSignUpWith
Description copied from interface:SignupManager
Return true if the given token is valid for a user to self-sign-up.- Specified by:
canSignUpWith
in interfaceSignupManager
- Parameters:
token
- a sign-up token from a URL given to an invited user
-
isEmailSentOnInviteSignUp
public boolean isEmailSentOnInviteSignUp()- Specified by:
isEmailSentOnInviteSignUp
in interfaceSignupManager
- Returns:
- true if notification emails should be sent to admins when a user signs themselves up.
-
isPublicSignupPermitted
public boolean isPublicSignupPermitted()Description copied from interface:SignupManager
Returns true if users can sign themselves for this instance.- Specified by:
isPublicSignupPermitted
in interfaceSignupManager
-
getRelativeSignupURL
- Specified by:
getRelativeSignupURL
in interfaceSignupManager
-
getSignupURL
- Specified by:
getSignupURL
in interfaceSignupManager
-
setEmailSentOnInviteSignUp
public void setEmailSentOnInviteSignUp(boolean notify) - Specified by:
setEmailSentOnInviteSignUp
in interfaceSignupManager
- Parameters:
notify
- true if notification emails should be sent to admins when a user signs themselves up, false if not
-
restorePreviousToken
Description copied from interface:SignupManager
Restore the previous private-signup token and returns it.- Specified by:
restorePreviousToken
in interfaceSignupManager
-
getSignUpToken
Description copied from interface:SignupManager
Gets the current sign-up token, or creates a new one and returns it.- Specified by:
getSignUpToken
in interfaceSignupManager
- Returns:
- a random sign-up token
-
sendInvites
Description copied from interface:SignupManager
Send invitation emails with a message to a list of email addresses.- Specified by:
sendInvites
in interfaceSignupManager
- Returns:
- the number of emails sent
-
sendConfirmationEmail
Description copied from interface:SignupManager
Sends a confirmation email to the given new user.- Specified by:
sendConfirmationEmail
in interfaceSignupManager
- Parameters:
token
- the token that the user must validate againstuser
- the new user
-
sendWelcomeEmail
Description copied from interface:SignupManager
Sends a welcome email to the given new user.- Specified by:
sendWelcomeEmail
in interfaceSignupManager
- Parameters:
user
- the new user
-
setPublicSignupMode
public void setPublicSignupMode()- Specified by:
setPublicSignupMode
in interfaceSignupManager
-
setPrivateSignupMode
public void setPrivateSignupMode()- Specified by:
setPrivateSignupMode
in interfaceSignupManager
-
setDomainRestrictedSignupMode
Description copied from interface:SignupManager
Set the domains that user's email address should belong to to be able to sign up.- Specified by:
setDomainRestrictedSignupMode
in interfaceSignupManager
- Parameters:
allowedDomains
- comma separated list of domains
-
getRestrictedDomains
Description copied from interface:SignupManager
Returns comma separated list of domains. Users with email in those domains are allowed to sign up. Provided domain restricted sign up is enabled.- Specified by:
getRestrictedDomains
in interfaceSignupManager
- Returns:
- comma separated list of domains
-
isEmailOnRestrictedDomain
Description copied from interface:SignupManager
Checks if the given email address is on one of the configured restricted domains.- Specified by:
isEmailOnRestrictedDomain
in interfaceSignupManager
- Parameters:
email
- the email address. Can be null.- Returns:
- true, if the domain name of the email matches one of the restricted domains.
-
isPendingConfirmation
public boolean isPendingConfirmation(com.atlassian.user.User user) Description copied from interface:SignupManager
Is given user tried to sign up but hasn't confirmed their email yet?- Specified by:
isPendingConfirmation
in interfaceSignupManager
- Returns:
- true if the given user tried to sign up but hasn't confirmed their email yet.
-
isTokenForUserValid
- Specified by:
isTokenForUserValid
in interfaceSignupManager
- Returns:
- true if given token a valid token that was issued when the given user tried to signup
-
doesUserHaveOutdatedSignupToken
public boolean doesUserHaveOutdatedSignupToken(com.atlassian.user.User user) - Specified by:
doesUserHaveOutdatedSignupToken
in interfaceSignupManager
- Returns:
- true if a given user has tried to sign up but hasn't confirmed their email within a reasonable time (1 month)
-
enableConfirmedUser
public void enableConfirmedUser(com.atlassian.user.User user) throws com.atlassian.crowd.exception.runtime.UserNotFoundException, com.atlassian.crowd.exception.runtime.OperationFailedException, com.atlassian.crowd.exception.InvalidUserException, com.atlassian.crowd.exception.OperationNotPermittedException Description copied from interface:SignupManager
Enable previously disabled user who signed up and confirmed their email.- Specified by:
enableConfirmedUser
in interfaceSignupManager
- Throws:
com.atlassian.crowd.exception.runtime.UserNotFoundException
com.atlassian.crowd.exception.runtime.OperationFailedException
com.atlassian.crowd.exception.InvalidUserException
com.atlassian.crowd.exception.OperationNotPermittedException
-
createUserPendingConfirmation
public String createUserPendingConfirmation(com.atlassian.user.User user, String password) throws com.atlassian.crowd.exception.runtime.OperationFailedException, com.atlassian.crowd.exception.InvalidUserException, com.atlassian.crowd.exception.InvalidCredentialException, com.atlassian.crowd.exception.OperationNotPermittedException Description copied from interface:SignupManager
Creates a new user and marks them disabled pending their email confirmation?- Specified by:
createUserPendingConfirmation
in interfaceSignupManager
- Parameters:
user
- the new userpassword
- the password for the new user- Returns:
- the token that the user must validate against in order to confirm their email
- Throws:
com.atlassian.crowd.exception.runtime.OperationFailedException
com.atlassian.crowd.exception.InvalidUserException
com.atlassian.crowd.exception.InvalidCredentialException
com.atlassian.crowd.exception.OperationNotPermittedException
-
isDomainRestrictedSignupEnabled
public boolean isDomainRestrictedSignupEnabled()- Specified by:
isDomainRestrictedSignupEnabled
in interfaceSignupManager
- Returns:
- true if sign up is enabled only for some specified domains
-