MediaWiki  1.27.2
MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider Class Reference

Handles email notification / email address confirmation for account creation. More...

Inheritance diagram for MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider:
Collaboration diagram for MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider:

Public Member Functions

 __construct ($params=[])
 
 beginSecondaryAccountCreation ($user, $creator, array $reqs)
 Start an account creation flow. More...
 
 beginSecondaryAuthentication ($user, array $reqs)
 Start an authentication flow. More...
 
 getAuthenticationRequests ($action, array $options)
 Return the applicable list of AuthenticationRequests. More...
 
 setConfig (Config $config)
 Set configuration. More...
 
- Public Member Functions inherited from MediaWiki\Auth\AbstractSecondaryAuthenticationProvider
 autoCreatedAccount ($user, $source)
 Post-auto-creation callback. More...
 
 continueSecondaryAccountCreation ($user, $creator, array $reqs)
 Continue an authentication flow. More...
 
 continueSecondaryAuthentication ($user, array $reqs)
 Continue an authentication flow. More...
 
 postAccountCreation ($user, $creator, AuthenticationResponse $response)
 Post-creation callback. More...
 
 postAuthentication ($user, AuthenticationResponse $response)
 Post-login callback. More...
 
 providerAllowsAuthenticationDataChange (AuthenticationRequest $req, $checkData=true)
 Validate a change of authentication data (e.g. More...
 
 providerAllowsPropertyChange ($property)
 Determine whether a property can change. More...
 
 providerChangeAuthenticationData (AuthenticationRequest $req)
 Change or remove authentication data (e.g. More...
 
 providerRevokeAccessForUser ($username)
 Revoke the user's credentials.This may cause the user to no longer exist for the provider, or the user may continue to exist in a "disabled" state.The intention is that the named account will never again be usable for normal login (i.e. there is no way to undo the revocation of access).
Parameters
string$username
More...
 
 testForAccountCreation ($user, $creator, array $reqs)
 Determine whether an account creation may begin. More...
 
 testUserForCreation ($user, $autocreate)
 Determine whether an account may be created. More...
 
- Public Member Functions inherited from MediaWiki\Auth\AbstractAuthenticationProvider
 getUniqueId ()
 Return a unique identifier for this instance.This must be the same across requests. If multiple instances return the same ID, exceptions will be thrown from AuthManager.
Returns
string
More...
 
 setConfig (Config $config)
 Set configuration. More...
 
 setLogger (LoggerInterface $logger)
 
 setManager (AuthManager $manager)
 Set AuthManager. More...
 

Protected Attributes

bool $sendConfirmationEmail
 
- Protected Attributes inherited from MediaWiki\Auth\AbstractAuthenticationProvider
Config $config
 
LoggerInterface $logger
 
AuthManager $manager
 

Detailed Description

Handles email notification / email address confirmation for account creation.

Set 'no-email' to true (via AuthManager::setAuthenticationSessionData) to skip this provider. Primary providers doing so are expected to take care of email address confirmation.

Definition at line 14 of file EmailNotificationSecondaryAuthenticationProvider.php.

Constructor & Destructor Documentation

MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider::__construct (   $params = [])
Parameters
array$params
  • sendConfirmationEmail: (bool) send an email asking the user to confirm their email address after a successful registration

Definition at line 25 of file EmailNotificationSecondaryAuthenticationProvider.php.

References $params.

Member Function Documentation

MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider::beginSecondaryAccountCreation (   $user,
  $creator,
array  $reqs 
)

Start an account creation flow.

Parameters
User$userUser being created (has been added to the database). This may become a "UserValue" in the future, or User may be refactored into such.
User$creatorUser doing the creation. This may become a "UserValue" in the future, or User may be refactored into such.
AuthenticationRequest[]$reqs
Returns
AuthenticationResponse Expected responses:
  • PASS: The user creation is ok. Additional secondary providers may run.
  • ABSTAIN: Additional secondary providers may run.
  • UI: Additional AuthenticationRequests are needed to complete the process.
  • REDIRECT: Redirection to a third party is needed to complete the process.

Implements MediaWiki\Auth\SecondaryAuthenticationProvider.

Definition at line 48 of file EmailNotificationSecondaryAuthenticationProvider.php.

References $status, $user, and MediaWiki\Auth\AuthenticationResponse\newPass().

MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider::beginSecondaryAuthentication (   $user,
array  $reqs 
)

Start an authentication flow.

Note that this may be called for a user even if beginSecondaryAccountCreation() was never called. The module should take the opportunity to do any necessary setup in that case.

Parameters
User$userUser being authenticated. This may become a "UserValue" in the future, or User may be refactored into such.
AuthenticationRequest[]$reqs
Returns
AuthenticationResponse Expected responses:
  • PASS: The user is authenticated. Additional secondary providers may run.
  • FAIL: The user is not authenticated. Fail the authentication process.
  • ABSTAIN: Additional secondary providers may run.
  • UI: Additional AuthenticationRequests are needed to complete the process.
  • REDIRECT: Redirection to a third party is needed to complete the process.

Implements MediaWiki\Auth\SecondaryAuthenticationProvider.

Definition at line 44 of file EmailNotificationSecondaryAuthenticationProvider.php.

References MediaWiki\Auth\AuthenticationResponse\newAbstain().

MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider::getAuthenticationRequests (   $action,
array  $options 
)

Return the applicable list of AuthenticationRequests.

Possible values for $action depend on whether the implementing class is also a PreAuthenticationProvider, PrimaryAuthenticationProvider, or SecondaryAuthenticationProvider.

  • ACTION_LOGIN: Valid for passing to beginAuthentication. Called on all providers.
  • ACTION_CREATE: Valid for passing to beginAccountCreation. Called on all providers.
  • ACTION_LINK: Valid for passing to beginAccountLink. Called on linking primary providers only.
  • ACTION_CHANGE: Valid for passing to AuthManager::changeAuthenticationData to change credentials. Called on primary and secondary providers.
  • ACTION_REMOVE: Valid for passing to AuthManager::changeAuthenticationData to remove credentials. Must work without additional user input (i.e. without calling loadFromSubmission). Called on primary and secondary providers.
See also
AuthManager::getAuthenticationRequests()
Parameters
string$action
array$optionsOptions are:
  • username: User name related to the action, or null/unset if anon.
    • ACTION_LOGIN: The currently logged-in user, if any.
    • ACTION_CREATE: The account creator, if non-anonymous.
    • ACTION_LINK: The local user being linked to.
    • ACTION_CHANGE: The user having data changed.
    • ACTION_REMOVE: The user having data removed. This does not need to be copied into the returned requests, you only need to pay attention to it if the set of requests differs based on the user.
Returns
AuthenticationRequest[]

Implements MediaWiki\Auth\AuthenticationProvider.

Definition at line 40 of file EmailNotificationSecondaryAuthenticationProvider.php.

MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider::setConfig ( Config  $config)

Set configuration.

Parameters
Config$config

Implements MediaWiki\Auth\AuthenticationProvider.

Definition at line 31 of file EmailNotificationSecondaryAuthenticationProvider.php.

Member Data Documentation

bool MediaWiki\Auth\EmailNotificationSecondaryAuthenticationProvider::$sendConfirmationEmail
protected

The documentation for this class was generated from the following file: