MediaWiki fundraising/REL1_35
|
Helper class for the password reset functionality shared by the web UI and the API. More...
Public Member Functions | |
__construct ( $config, AuthManager $authManager, PermissionManager $permissionManager, ILoadBalancer $loadBalancer=null, LoggerInterface $logger=null, HookContainer $hookContainer=null) | |
This class is managed by MediaWikiServices, don't instantiate directly. | |
execute (User $performingUser, $username=null, $email=null) | |
Do a password reset. | |
isAllowed (User $user) | |
Check if a given user has permission to use this functionality. | |
Public Attributes | |
const | CONSTRUCTOR_OPTIONS |
Protected Member Functions | |
getUsersByEmail ( $email) | |
isBlocked (User $user) | |
Check whether the user is blocked. | |
lookupUser ( $username) | |
User object creation helper for testability. | |
Protected Attributes | |
AuthManager | $authManager |
ServiceOptions Config | $config |
ILoadBalancer | $loadBalancer |
PermissionManager | $permissionManager |
Private Attributes | |
HookContainer | $hookContainer |
HookRunner | $hookRunner |
MapCacheLRU | $permissionCache |
In-process cache for isAllowed lookups, by username. | |
Helper class for the password reset functionality shared by the web UI and the API.
Requires the TemporaryPasswordPrimaryAuthenticationProvider and the EmailNotificationSecondaryAuthenticationProvider (or something providing equivalent functionality) to be enabled.
Definition at line 43 of file PasswordReset.php.
PasswordReset::__construct | ( | $config, | |
AuthManager | $authManager, | ||
PermissionManager | $permissionManager, | ||
ILoadBalancer | $loadBalancer = null, | ||
LoggerInterface | $logger = null, | ||
HookContainer | $hookContainer = null ) |
This class is managed by MediaWikiServices, don't instantiate directly.
ServiceOptions | Config | $config | |
AuthManager | $authManager | |
PermissionManager | $permissionManager | |
ILoadBalancer | null | $loadBalancer | |
LoggerInterface | null | $logger | |
HookContainer | null | $hookContainer |
Definition at line 87 of file PasswordReset.php.
References wfDeprecatedMsg().
PasswordReset::execute | ( | User | $performingUser, |
$username = null, | |||
$email = null ) |
Do a password reset.
Authorization is the caller's responsibility.
Process the form. At this point we know that the user passes all the criteria in userCanExecute(), and if the data array contains 'Username', etc, then Username resets are allowed.
User | $performingUser | The user that does the password reset |
string | null | $username | The user whose password is reset |
string | null | Alternative way to specify the user |
LogicException | When the user is not allowed to perform the action |
MWException | On unexpected DB errors |
Definition at line 179 of file PasswordReset.php.
References User\getId(), User\getName(), User\getRequest(), getUsersByEmail(), isAllowed(), lookupUser(), Message\newFromSpecifier(), and User\pingLimiter().
|
protected |
string |
MWException | On unexpected database errors |
Definition at line 360 of file PasswordReset.php.
References $res, and DB_REPLICA.
Referenced by execute().
PasswordReset::isAllowed | ( | User | $user | ) |
Check if a given user has permission to use this functionality.
User | $user |
Definition at line 128 of file PasswordReset.php.
References User\getName(), and isBlocked().
Referenced by execute().
|
protected |
Check whether the user is blocked.
Ignores certain types of system blocks that are only meant to force users to log in.
User | $user |
Definition at line 347 of file PasswordReset.php.
References User\getBlock(), and User\getGlobalBlock().
Referenced by isAllowed().
|
protected |
User object creation helper for testability.
string | $username |
Definition at line 390 of file PasswordReset.php.
Referenced by execute().
|
protected |
Definition at line 50 of file PasswordReset.php.
|
protected |
Definition at line 47 of file PasswordReset.php.
|
private |
Definition at line 59 of file PasswordReset.php.
|
private |
Definition at line 62 of file PasswordReset.php.
|
protected |
Definition at line 56 of file PasswordReset.php.
|
private |
In-process cache for isAllowed lookups, by username.
Contains a StatusValue object
Definition at line 69 of file PasswordReset.php.
|
protected |
Definition at line 53 of file PasswordReset.php.
const PasswordReset::CONSTRUCTOR_OPTIONS |
Definition at line 71 of file PasswordReset.php.