Manual:Hooks/LoginUserMigrated
Appearance
This feature was removed from MediaWiki core in version 1.33.0 (after being deprecated in 1.27.0). Please see MediaWiki\Auth\PreAuthenticationProvider for an alternative way to use this feature. |
LoginUserMigrated | |
---|---|
Available from version 1.26.0 Removed in version 1.33.0 (Gerrit change 441513) allows extensions to inform a user that their username doesn't exist for a specific reason | |
Define function: | public static function onLoginUserMigrated( User $user, &$msg ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"LoginUserMigrated": "MediaWiki\\Extension\\MyExtension\\Hooks::onLoginUserMigrated"
}
}
|
Called from: | File(s): user/User.php |
Interface: | LoginUserMigratedHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:LoginUserMigrated extensions.
Details
[edit]This allows providing a reason to the user why their username doesn't exist, instead of letting the login form give the generic error message that the account does not exist. For example, when the account has been renamed or deleted.
$user
: The User object being authenticated against.&$msg
: The message identifier for abort reason, or an array to pass a message key and parameters.