Available from version 1.18.0 (r85410)
Removed in version 1.33.0
Allow to cancel automated local account creation, where normally authentication against an external auth plugin would be creating a local account.
Define function:
public static function onAbortAutoAccount( User $user, &$abortMsg ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"AbortAutoAccount": "MyExtensionHooks::onAbortAutoAccount"

For MediaWiki ≤1.25:

$wgHooks['AbortAutoAccount'][] = 'MyExtensionHooks::onAbortAutoAccount';
Called from:File(s): specials/SpecialUserLogin.php

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


  • $user: the User object about to be created (read-only, incomplete)
  • &$abortMsg: out parameter: name of error message to be displayed to user

Return false to cancel automated local account creation.