|
MediaWiki master
|
Password reset helper for functionality shared by the web UI and the API. More...
Inherits LoggerAwareInterface.

Public Member Functions | |
| __construct (private readonly ServiceOptions $config, LoggerInterface $logger, private readonly AuthManager $authManager, HookContainer $hookContainer, private readonly UserIdentityLookup $userIdentityLookup, private readonly UserFactory $userFactory, private readonly UserNameUtils $userNameUtils, private readonly 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 35 of file PasswordReset.php.
| MediaWiki\User\PasswordReset::__construct | ( | private readonly ServiceOptions | $config, |
| LoggerInterface | $logger, | ||
| private readonly AuthManager | $authManager, | ||
| HookContainer | $hookContainer, | ||
| private readonly UserIdentityLookup | $userIdentityLookup, | ||
| private readonly UserFactory | $userFactory, | ||
| private readonly UserNameUtils | $userNameUtils, | ||
| private readonly UserOptionsLookup | $userOptionsLookup ) |
This class is managed by MediaWikiServices, don't instantiate directly.
Definition at line 57 of file PasswordReset.php.
| 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 147 of file PasswordReset.php.
References MediaWiki\User\User\getName(), MediaWiki\User\User\getRequest(), and MediaWiki\User\User\pingLimiter().
|
protected |
| string |
Definition at line 307 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 81 of file PasswordReset.php.
References MediaWiki\User\User\getName().
| MediaWiki\User\PasswordReset::isEnabled | ( | ) |
Definition at line 93 of file PasswordReset.php.
| const MediaWiki\User\PasswordReset::CONSTRUCTOR_OPTIONS |
Definition at line 49 of file PasswordReset.php.