Package com.atlassian.confluence.user
Interface SignupManager
-
- All Known Implementing Classes:
DefaultSignupManager
public interface SignupManager
Provides methods for adding users easily.- Since:
- 4.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canSignUpWith(String token)
Return true if the given token is valid for a user to self-sign-up.String
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.String
getRelativeSignupURL()
String
getRestrictedDomains()
Returns comma separated list of domains.String
getSignUpToken()
Gets the current sign-up token, or creates a new one and returns it.String
getSignupURL()
boolean
isDomainRestrictedSignupEnabled()
boolean
isEmailOnRestrictedDomain(String email)
Checks if the given email address is on one of the configured restricted domains.boolean
isEmailSentOnInviteSignUp()
boolean
isPendingConfirmation(com.atlassian.user.User user)
Is given user tried to sign up but hasn't confirmed their email yet?boolean
isPublicSignupPermitted()
Returns true if users can sign themselves for this instance.boolean
isTokenForUserValid(com.atlassian.user.User user, String token)
String
refreshAndGetToken()
Creates a new sign-up token and returns it.String
restorePreviousToken()
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.NotificationSendResult
sendInvites(SendUserInviteEvent event)
Send invitation emails with a message to a list of email addresses.void
sendWelcomeEmail(ConfluenceUser user)
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
setPrivateSignupMode()
void
setPublicSignupMode()
-
-
-
Method Detail
-
getSignUpToken
String getSignUpToken()
Gets the current sign-up token, or creates a new one and returns it.- Returns:
- a random sign-up token
-
canSignUpWith
boolean canSignUpWith(String token)
Return true if the given token is valid for a user to self-sign-up.- Parameters:
token
- a sign-up token from a URL given to an invited user
-
refreshAndGetToken
String refreshAndGetToken()
Creates a new sign-up token and returns it. This invalidates the previous token.- Returns:
- a random sign-up token
-
isEmailSentOnInviteSignUp
boolean isEmailSentOnInviteSignUp()
- Returns:
- true if notification emails should be sent to admins when a user signs themselves up.
-
setEmailSentOnInviteSignUp
void setEmailSentOnInviteSignUp(boolean notify)
- Parameters:
notify
- true if notification emails should be sent to admins when a user signs themselves up, false if not
-
restorePreviousToken
String restorePreviousToken()
Restore the previous private-signup token and returns it.
-
getSignupURL
String getSignupURL()
-
getRelativeSignupURL
String getRelativeSignupURL()
-
isPublicSignupPermitted
boolean isPublicSignupPermitted()
Returns true if users can sign themselves for this instance.
-
sendInvites
NotificationSendResult sendInvites(SendUserInviteEvent event)
Send invitation emails with a message to a list of email addresses.- Returns:
- the number of emails sent
-
sendConfirmationEmail
void sendConfirmationEmail(String token, com.atlassian.user.User user)
Sends a confirmation email to the given new user.- Parameters:
token
- the token that the user must validate againstuser
- the new user
-
sendWelcomeEmail
void sendWelcomeEmail(ConfluenceUser user)
Sends a welcome email to the given new user.- Parameters:
user
- the new user
-
setPublicSignupMode
void setPublicSignupMode()
-
setPrivateSignupMode
void setPrivateSignupMode()
-
setDomainRestrictedSignupMode
void setDomainRestrictedSignupMode(String allowedDomains)
Set the domains that user's email address should belong to to be able to sign up.- Parameters:
allowedDomains
- comma separated list of domains
-
getRestrictedDomains
String getRestrictedDomains()
Returns comma separated list of domains. Users with email in those domains are allowed to sign up. Provided domain restricted sign up is enabled.- Returns:
- comma separated list of domains
-
isEmailOnRestrictedDomain
boolean isEmailOnRestrictedDomain(String email)
Checks if the given email address is on one of the configured restricted domains.- Parameters:
email
- the email address. Can be null.- Returns:
- true, if the domain name of the email matches one of the restricted domains.
-
isPendingConfirmation
boolean isPendingConfirmation(com.atlassian.user.User user)
Is given user tried to sign up but hasn't confirmed their email yet?- Parameters:
user
-- Returns:
- true if the given user tried to sign up but hasn't confirmed their email yet.
-
createUserPendingConfirmation
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
Creates a new user and marks them disabled pending their email confirmation?- 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
-
enableConfirmedUser
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
Enable previously disabled user who signed up and confirmed their email.- Parameters:
user
-- Throws:
com.atlassian.crowd.exception.runtime.UserNotFoundException
com.atlassian.crowd.exception.runtime.OperationFailedException
com.atlassian.crowd.exception.InvalidUserException
com.atlassian.crowd.exception.OperationNotPermittedException
-
isTokenForUserValid
boolean isTokenForUserValid(com.atlassian.user.User user, String token)
- Parameters:
user
-token
-- Returns:
- true if given token a valid token that was issued when the given user tried to signup
-
doesUserHaveOutdatedSignupToken
boolean doesUserHaveOutdatedSignupToken(com.atlassian.user.User user)
- Parameters:
user
-- Returns:
- true if a given user has tried to sign up but hasn't confirmed their email within a reasonable time (1 month)
-
isDomainRestrictedSignupEnabled
boolean isDomainRestrictedSignupEnabled()
- Returns:
- true if sign up is enabled only for some specified domains
-
-