Manual:Hooks/AbortLogin

From MediaWiki.org

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

*Define function:
function fnMyHook( $user, $password, &$retval ) { ... }

*Attach hook:
$wgHooks['AbortLogin'][] = 'fnMyHook';
Called from: SpecialUserlogin.php

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

[edit] 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)

[edit] 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.