Manual:Hooks/AuthPluginAutoCreate

From MediaWiki.org
Jump to navigation Jump to search
AuthPluginAutoCreate
Available from version 1.13.0
Called when creating a local account for an user logged in from an external authentication method
Define function:
public static function onAuthPluginAutoCreate( $user ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"AuthPluginAutoCreate": "MyExtensionHooks::onAuthPluginAutoCreate"
	}
}

For MediaWiki ≤1.25:

$wgHooks['AuthPluginAutoCreate'][] = 'MyExtensionHooks::onAuthPluginAutoCreate';
Called from:File(s): SpecialUserlogin.php

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

Details[edit]

  • $user: User object created locally

Deprecated[edit]

From MediaWiki 1.27 on, the hook is deprecated and superseded by LocalUserCreated, as part of the changes that introduced AuthManager.