Jump to main content Jump to doc navigation

ConfirmRegister

Other versions: 2.x (current) — Found a problem? Please edit this page or report an issue.

What is ConfirmRegister?

ConfirmRegister is a simple snippet that confirms a registration by a User from the Register snippet, when 'activation' in that snippet is set to 1 (the default). It is placed on a separate, "Registration Activated" page.

Usage

Register by default requires the User to activate their account before logging in. The Snippet creates the modUser object and sets its "active" field to 0. The User then gets an email with a URL to activate their account with. Once the User visits the page, their account is set to "active=1", and they can then login.

To enable this, you will need to create an Activation page by creating a new Resource, and putting this ConfirmRegister snippet inside of it:

[[!ConfirmRegister]]

An example Register snippet call with activation would look like this:

[[!Register?
  &activationEmailTpl=`myActivationEmailTpl`
  &activationEmailSubject=`Please activate your account!`
  &activationResourceId=`26`
]]

This would send the User the email specified in the "myActivationEmailTpl" chunk, with the specified subject line, which will direct the User to the Resource 26 - the Resource you put the ConfirmRegister snippet call in - to activate their account.

Default Properties

ConfirmRegister has some default properties packaged into it. They are:

Name Description Default
redirectTo Optional. After a successful confirmation, redirect to this Resource.
redirectParams Optional. A JSON object of parameters to pass when redirecting using redirectTo.
authenticate Authenticate and login the user to the current context after confirming registration. 1
authenticateContexts Optional. A comma-separated list of contexts to authenticate to. Defaults to the current context.
errorPage Optional. If set, will redirect user to a custom error page if they try to access this page after activating their account.

Events

ConfirmRegister also fires the OnUserActivate plugin event after the User is activated, and passes in a 'user' parameter, which contains the newly-activated modUser object.

See Also

  1. Login.Login
  2. Login.Profile
  3. Login.UpdateProfile
  4. Login.Register
    1. Register.Example Form 1
  5. Login.ConfirmRegister
  6. Login.ForgotPassword
  7. Login.ResetPassword
  8. Login.ChangePassword
  9. Login.Tutorials
    1. Login.Basic Setup
    2. Login.Extended User Profiles
    3. Login.Request Membership
    4. Login.User Profiles
    5. Login.Using Custom Fields
  10. Login.Using Pre and Post Hooks
  11. Login.Roadmap