MediaWiki master
|
Password reset helper for functionality shared by the web UI and the API. More...
Inherits LoggerAwareInterface.
Public Member Functions | |
__construct (ServiceOptions $config, LoggerInterface $logger, AuthManager $authManager, HookContainer $hookContainer, UserIdentityLookup $userIdentityLookup, 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. | |
isEnabled () | |
Public Attributes | |
const | CONSTRUCTOR_OPTIONS |
Protected Member Functions | |
getUsersByEmail ( $email) | |
Password reset helper for 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 49 of file PasswordReset.php.
MediaWiki\User\PasswordReset::__construct | ( | ServiceOptions | $config, |
LoggerInterface | $logger, | ||
AuthManager | $authManager, | ||
HookContainer | $hookContainer, | ||
UserIdentityLookup | $userIdentityLookup, | ||
UserFactory | $userFactory, | ||
UserNameUtils | $userNameUtils, | ||
UserOptionsLookup | $userOptionsLookup ) |
This class is managed by MediaWikiServices, don't instantiate directly.
ServiceOptions | $config | |
LoggerInterface | $logger | |
AuthManager | $authManager | |
HookContainer | $hookContainer | |
UserIdentityLookup | $userIdentityLookup | |
UserFactory | $userFactory | |
UserNameUtils | $userNameUtils | |
UserOptionsLookup | $userOptionsLookup |
Definition at line 86 of file PasswordReset.php.
References MediaWiki\Config\ServiceOptions\assertRequiredOptions().
MediaWiki\User\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 |
Definition at line 184 of file PasswordReset.php.
References MediaWiki\User\User\getName(), MediaWiki\User\User\getRequest(), and MediaWiki\User\User\pingLimiter().
|
protected |
string |
Definition at line 346 of file PasswordReset.php.
MediaWiki\User\PasswordReset::isAllowed | ( | User | $user | ) |
Check if a given user has permission to use this functionality.
User | $user |
Definition at line 117 of file PasswordReset.php.
References MediaWiki\User\User\getName().
MediaWiki\User\PasswordReset::isEnabled | ( | ) |
const MediaWiki\User\PasswordReset::CONSTRUCTOR_OPTIONS |
Definition at line 69 of file PasswordReset.php.