MediaWiki 1.39.10
|
Helper class for the password reset functionality shared by the web UI and the API. More...
Public Member Functions | |
__construct (ServiceOptions $config, LoggerInterface $logger, AuthManager $authManager, HookContainer $hookContainer, ILoadBalancer $loadBalancer, UserFactory $userFactory, UserNameUtils $userNameUtils, UserOptionsLookup $userOptionsLookup) | |
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) | |
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 44 of file PasswordReset.php.
PasswordReset::__construct | ( | ServiceOptions | $config, |
LoggerInterface | $logger, | ||
AuthManager | $authManager, | ||
HookContainer | $hookContainer, | ||
ILoadBalancer | $loadBalancer, | ||
UserFactory | $userFactory, | ||
UserNameUtils | $userNameUtils, | ||
UserOptionsLookup | $userOptionsLookup ) |
This class is managed by MediaWikiServices, don't instantiate directly.
ServiceOptions | $config | |
LoggerInterface | $logger | |
AuthManager | $authManager | |
HookContainer | $hookContainer | |
ILoadBalancer | $loadBalancer | |
UserFactory | $userFactory | |
UserNameUtils | $userNameUtils | |
UserOptionsLookup | $userOptionsLookup |
Definition at line 96 of file PasswordReset.php.
References MediaWiki\Config\ServiceOptions\assertRequiredOptions().
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 185 of file PasswordReset.php.
References User\getId(), User\getName(), User\getRequest(), Message\newFromSpecifier(), and User\pingLimiter().
|
protected |
string |
MWException | On unexpected database errors |
Definition at line 372 of file PasswordReset.php.
References $res, DB_REPLICA, and User\getQueryInfo().
PasswordReset::isAllowed | ( | User | $user | ) |
Check if a given user has permission to use this functionality.
User | $user |
Definition at line 127 of file PasswordReset.php.
References User\getName().
const PasswordReset::CONSTRUCTOR_OPTIONS |
Definition at line 78 of file PasswordReset.php.