Manual:Hooks/AddNewAccount

From Linux Web Expert

AddNewAccount
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Called after a user account is created
<translate> Define function:</translate>
public static function onAddNewAccount( User $user, $byEmail ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"AddNewAccount": "MediaWiki\\Extension\\MyExtension\\Hooks::onAddNewAccount"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> specials/SpecialUserLogin.php
<translate> Interface:</translate> AddNewAccountHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:AddNewAccount extensions</tvar>.</translate>


Details

  • $user: the User object that was created. <translate> (introduced in <tvar
  • $byEmail: true when account was created "by email" <translate> (introduced in <tvar

This does not include accounts auto-created by authentication extensions like CentralAuth . For that, see AuthPluginAutoCreate .