MediaWiki  1.33.0
TitleBlacklistPreAuthenticationProvider Class Reference
Inheritance diagram for TitleBlacklistPreAuthenticationProvider:
Collaboration diagram for TitleBlacklistPreAuthenticationProvider:

Public Member Functions

 __construct ( $params=[])
 
 getAuthenticationRequests ( $action, array $options)
 Return the applicable list of AuthenticationRequests. More...
 
 testForAccountCreation ( $user, $creator, array $reqs)
 Determine whether an account creation may begin. More...
 
 testUserForCreation ( $user, $autocreate, array $options=[])
 Determine whether an account may be created. More...
 
- Public Member Functions inherited from MediaWiki\Auth\AbstractPreAuthenticationProvider
 postAccountCreation ( $user, $creator, AuthenticationResponse $response)
 Post-creation callback. More...
 
 postAccountLink ( $user, AuthenticationResponse $response)
 Post-link callback. More...
 
 postAuthentication ( $user, AuthenticationResponse $response)
 Post-login callback. More...
 
 testForAccountLink ( $user)
 Determine whether an account may linked to another authentication method. More...
 
 testForAuthentication (array $reqs)
 Determine whether an authentication may begin. More...
 
- Public Member Functions inherited from MediaWiki\Auth\AbstractAuthenticationProvider
 getUniqueId ()
 @inheritDoc More...
 
 setConfig (Config $config)
 Set configuration. More...
 
 setLogger (LoggerInterface $logger)
 
 setManager (AuthManager $manager)
 Set AuthManager. More...
 

Protected Attributes

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

Detailed Description

Definition at line 7 of file TitleBlacklistPreAuthenticationProvider.php.

Constructor & Destructor Documentation

◆ __construct()

TitleBlacklistPreAuthenticationProvider::__construct (   $params = [])

Definition at line 10 of file TitleBlacklistPreAuthenticationProvider.php.

References $params.

Member Function Documentation

◆ getAuthenticationRequests()

TitleBlacklistPreAuthenticationProvider::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. If you leave the username property of the returned requests empty, this will automatically be copied there (except for ACTION_CREATE where it wouldn't really make sense).
Returns
AuthenticationRequest[]

Reimplemented from MediaWiki\Auth\AbstractPreAuthenticationProvider.

Definition at line 20 of file TitleBlacklistPreAuthenticationProvider.php.

References $options, $user, User\newFromName(), User, and TitleBlacklist\userCanOverride().

◆ testForAccountCreation()

TitleBlacklistPreAuthenticationProvider::testForAccountCreation (   $user,
  $creator,
array  $reqs 
)

Determine whether an account creation may begin.

Called from AuthManager::beginAccountCreation()

Note
No need to test if the account exists, AuthManager checks that
Parameters
User$userUser being created (not added to the database yet). 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
StatusValue

Reimplemented from MediaWiki\Auth\AbstractPreAuthenticationProvider.

Definition at line 32 of file TitleBlacklistPreAuthenticationProvider.php.

References $req, $user, class, TitleBlacklistHooks\testUserName(), and true.

◆ testUserForCreation()

TitleBlacklistPreAuthenticationProvider::testUserForCreation (   $user,
  $autocreate,
array  $options = [] 
)

Determine whether an account may be created.

Parameters
User$userUser being created (not added to the database yet). This may become a "UserValue" in the future, or User may be refactored into such.
bool | string$autocreateFalse if this is not an auto-creation, or the source of the auto-creation passed to AuthManager::autoCreateUser().
array$options
  • flags: (int) Bitfield of User:READ_* constants, default User::READ_NORMAL
  • creating: (bool) If false (or missing), this call is only testing if a user could be created. If set, this (non-autocreation) is for actually creating an account and will be followed by a call to testForAccountCreation(). In this case, the provider might return StatusValue::newGood() here and let the later call to testForAccountCreation() do a more thorough test.
Returns
StatusValue

Reimplemented from MediaWiki\Auth\AbstractPreAuthenticationProvider.

Definition at line 47 of file TitleBlacklistPreAuthenticationProvider.php.

References $options, $user, RequestContext\getMain(), StatusValue\newGood(), and TitleBlacklistHooks\testUserName().

Member Data Documentation

◆ $blockAutoAccountCreation

TitleBlacklistPreAuthenticationProvider::$blockAutoAccountCreation
protected

Definition at line 8 of file TitleBlacklistPreAuthenticationProvider.php.


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