Manual:Hooks/AddNewAccount
This deprecated feature should no longer be used, but is still available for reasons of backwards compatibility. This feature was deprecated in version 1.27.0. This was deprecated as part of the changes that introduced AuthManager . Logic that interacts with form fields or other request data should be moved into a provider.Please see LocalUserCreated for an alternative way to use this feature. |
AddNewAccount | |
---|---|
Available from version 1.5.0 Called after a user account is created | |
Define function: | public static function onAddNewAccount( User $user, $byEmail ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"AddNewAccount": "MyExtensionHooks::onAddNewAccount"
}
}
|
Called from: | File(s): specials/SpecialUserLogin.php |
Interface: | AddNewAccountHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:AddNewAccount extensions.
Details edit
$user
: the User object that was created. (introduced in 1.7)$byEmail
: true when account was created "by email" (introduced in 1.12)
This does not include accounts auto-created by authentication extensions like CentralAuth . For that, see AuthPluginAutoCreate .