This page is a translated version of the page Manual:Hooks/LocalUserCreated and the translation is 7% complete.
Erhältlich ab Version 1.26.0
Wird sofort aufgerufen, nachdem ein lokaler Benutzer erstellt und in die Datenbank abgespeichert wurde
Funktion definieren:
public static function onLocalUserCreated( $user, $autocreated ) { ... }
Haken anbringen: In extension.json:
	"Hooks": {
		"LocalUserCreated": "MediaWiki\\Extension\\MyExtension\\Hooks::onLocalUserCreated"
Angerufen von: Datei(en): auth/AuthManager.php
Interface: LocalUserCreatedHook.php

For more information about attaching hooks, see Handbuch:Hooks .
For examples of extensions using this hook, see Category:LocalUserCreated extensions/de.


  • $user - User object for the created user
  • $autocreated - Boolean, whether this was an auto-creation. Note if your wiki uses CentralAuth this will always be true.


Added in MediaWiki 1.26 as part of the AuthManager system. Replaces the AuthPlugin::initUser() method call and the AddNewAccount and AuthPluginAutoCreate hooks.

Extensions which implement their own authentication provider might want to use AuthManager::autoCreatedAccount and AuthManager::postAccountCreation instead, which are similar but have access to more information. (Note that postAccountCreation is called significantly later in the process, after secondary authentication providers have finished.)

Changes which are not immediately required for database consistency should probably be deferred; see Database transactions .

If $wgAutoCreateTempUser is active, this hook is also called when a temporary account is automatically created for a logged-out user.

See also