Manual:Hooks/AbortLogin

From MediaWiki.org
Jump to: navigation, search
AbortLogin
Available from version 1.10.0
Can cancel the login process

Define function:
public static function onAbortLogin( $user, $password, &$retval ) { ... }

Attach hook:
$wgHooks['AbortLogin'][] = 'MyExtensionHooks::onAbortLogin';
Called from: File(s):SpecialUserlogin.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:AbortLogin extensions.

Details[edit | edit source]

  • $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)

Notes[edit | edit source]

  • 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.