MediaWiki REL1_27
MediaWiki\Auth\LegacyHookPreAuthenticationProvider Class Reference

A pre-authentication provider to call some legacy hooks. More...

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

Public Member Functions

 testForAccountCreation ( $user, $creator, array $reqs)
 Determine whether an account creation may begin.
 
 testForAuthentication (array $reqs)
 Determine whether an authentication may begin.
 
 testUserForCreation ( $user, $autocreate)
 Determine whether an account may be created.
 
- Public Member Functions inherited from MediaWiki\Auth\AbstractPreAuthenticationProvider
 getAuthenticationRequests ( $action, array $options)
 Return the applicable list of AuthenticationRequests.
 
 postAccountCreation ( $user, $creator, AuthenticationResponse $response)
 Post-creation callback.
 
 postAccountLink ( $user, AuthenticationResponse $response)
 Post-link callback.
 
 postAuthentication ( $user, AuthenticationResponse $response)
 Post-login callback.
 
 testForAccountLink ( $user)
 Determine whether an account may linked to another authentication method.
 
- 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

 
 setConfig (Config $config)
 Set configuration.
 
 setLogger (LoggerInterface $logger)
 
 setManager (AuthManager $manager)
 Set AuthManager.
 

Protected Member Functions

 makeFailResponse ( $user, $creator, $constant, $msg, $hook)
 Construct an appropriate failure response.
 

Additional Inherited Members

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

Detailed Description

A pre-authentication provider to call some legacy hooks.

Since
1.27
Deprecated:
since 1.27

Definition at line 34 of file LegacyHookPreAuthenticationProvider.php.

Member Function Documentation

◆ makeFailResponse()

MediaWiki\Auth\LegacyHookPreAuthenticationProvider::makeFailResponse (   $user,
  $creator,
  $constant,
  $msg,
  $hook 
)
protected

◆ testForAccountCreation()

MediaWiki\Auth\LegacyHookPreAuthenticationProvider::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 74 of file LegacyHookPreAuthenticationProvider.php.

References $ret, $user, Hooks\run(), and wfMessage().

◆ testForAuthentication()

MediaWiki\Auth\LegacyHookPreAuthenticationProvider::testForAuthentication ( array  $reqs)

Determine whether an authentication may begin.

Called from AuthManager::beginAuthentication()

Parameters
AuthenticationRequest[]$reqs
Returns
StatusValue

Reimplemented from MediaWiki\Auth\AbstractPreAuthenticationProvider.

Definition at line 36 of file LegacyHookPreAuthenticationProvider.php.

References $req, $user, LoginForm\ABORTED, as, MediaWiki\Auth\AuthenticationRequest\getRequestByClass(), MediaWiki\Auth\LegacyHookPreAuthenticationProvider\makeFailResponse(), Hooks\run(), LoginForm\USER_MIGRATED, and wfRandomString().

◆ testUserForCreation()

MediaWiki\Auth\LegacyHookPreAuthenticationProvider::testUserForCreation (   $user,
  $autocreate 
)

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().
Returns
StatusValue

Reimplemented from MediaWiki\Auth\AbstractPreAuthenticationProvider.

Definition at line 99 of file LegacyHookPreAuthenticationProvider.php.

References $ret, $user, LoginForm\ABORTED, MediaWiki\Auth\LegacyHookPreAuthenticationProvider\makeFailResponse(), Hooks\run(), and wfMessage().


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