MediaWiki
1.33.0
|
Public Member Functions | |
getAuthenticationRequests ( $action, array $options) | |
Return the applicable list of AuthenticationRequests. More... | |
postAuthentication ( $user, AuthenticationResponse $response) | |
Post-login callback. More... | |
testForAccountCreation ( $user, $creator, array $reqs) | |
Determine whether an account creation may begin. More... | |
testForAuthentication (array $reqs) | |
Determine whether an authentication may begin. 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... | |
testForAccountLink ( $user) | |
Determine whether an account may linked to another authentication method. More... | |
testUserForCreation ( $user, $autocreate, array $options=[]) | |
Determine whether an account may be created. 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 Member Functions | |
makeError ( $message, SimpleCaptcha $captcha) | |
verifyCaptcha (SimpleCaptcha $captcha, array $reqs, User $user) | |
Verify submitted captcha. More... | |
Additional Inherited Members | |
Protected Attributes inherited from MediaWiki\Auth\AbstractAuthenticationProvider | |
Config | $config |
LoggerInterface | $logger |
AuthManager | $manager |
Definition at line 9 of file CaptchaPreAuthenticationProvider.php.
CaptchaPreAuthenticationProvider::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.
string | $action | |
array | $options | Options are:
|
Reimplemented from MediaWiki\Auth\AbstractPreAuthenticationProvider.
Definition at line 10 of file CaptchaPreAuthenticationProvider.php.
References $options, $user, ConfirmEditHooks\getInstance(), User\newFromName(), and User.
|
protected |
string | $message | Message key |
SimpleCaptcha | $captcha |
Definition at line 152 of file CaptchaPreAuthenticationProvider.php.
References SimpleCaptcha\getError(), StatusValue\newFatal(), and wfMessage().
Referenced by testForAccountCreation(), and testForAuthentication().
CaptchaPreAuthenticationProvider::postAuthentication | ( | $user, | |
AuthenticationResponse | $response | ||
) |
Post-login callback.
This will be called at the end of a login attempt. It will not be called for unfinished login attempts that fail by the session timing out.
User | null | $user | User that was attempted to be logged in, if known. This may become a "UserValue" in the future, or User may be refactored into such. |
AuthenticationResponse | $response | Authentication response that will be returned (PASS or FAIL) |
Reimplemented from MediaWiki\Auth\AbstractPreAuthenticationProvider.
Definition at line 114 of file CaptchaPreAuthenticationProvider.php.
References $response, $user, ConfirmEditHooks\getInstance(), and null.
CaptchaPreAuthenticationProvider::testForAccountCreation | ( | $user, | |
$creator, | |||
array | $reqs | ||
) |
Determine whether an account creation may begin.
Called from AuthManager::beginAccountCreation()
User | $user | User being created (not added to the database yet). This may become a "UserValue" in the future, or User may be refactored into such. |
User | $creator | User doing the creation. This may become a "UserValue" in the future, or User may be refactored into such. |
AuthenticationRequest[] | $reqs |
Reimplemented from MediaWiki\Auth\AbstractPreAuthenticationProvider.
Definition at line 94 of file CaptchaPreAuthenticationProvider.php.
References $success, $user, $username, ConfirmEditHooks\getInstance(), makeError(), StatusValue\newGood(), and verifyCaptcha().
CaptchaPreAuthenticationProvider::testForAuthentication | ( | array | $reqs | ) |
Determine whether an authentication may begin.
Called from AuthManager::beginAuthentication()
AuthenticationRequest[] | $reqs |
Reimplemented from MediaWiki\Auth\AbstractPreAuthenticationProvider.
Definition at line 66 of file CaptchaPreAuthenticationProvider.php.
References $success, $username, ConfirmEditHooks\getInstance(), makeError(), StatusValue\newGood(), User, and verifyCaptcha().
|
protected |
Verify submitted captcha.
Assumes that the user has to pass the capctha (permission checks are caller's responsibility).
SimpleCaptcha | $captcha | |
AuthenticationRequest[] | $reqs | |
User | $user |
Definition at line 137 of file CaptchaPreAuthenticationProvider.php.
References $req, $user, class, and SimpleCaptcha\passCaptchaLimited().
Referenced by testForAccountCreation(), and testForAuthentication().