< Manual:Hooks 
 
      |  | 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. | 
| AbortLogin | |
|---|---|
| Available from version 1.11.0 Removed in version 1.33.0 Can cancel the login process | |
| Define function: | public static function onAbortLogin( User $user, $password, LoginForm &$retVal, &$msg ) { ... }
 | 
| Attach hook: | In extension.json: {
	"Hooks": {
		"AbortLogin": "MyExtensionHooks::onAbortLogin"
	}
}
 | 
| Called from: | File(s): specials/SpecialUserLogin.php | 
| Interface: | AbortLoginHook.php | 
For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:AbortLogin extensions.
Details
- $user: User object being authenticated against
- $password: password being submitted (before validity checks)
- &$retVal: a LoginForm class constant to return from authenticateUserData (default is- LoginForm::ABORTED)
- &$msg: name of the error message displayed to the user (introduced in 1.18)
Notes
- Can be used to allow an extension (for example, a captcha) to abort the login process
- For &$retVal, note that client may be using a machine API rather than the HTML user interface.
    This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.