Manual:Hooks/LocalUserCreated/ja
LocalUserCreated | |
---|---|
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate> ローカルユーザーが作成され、データベースに保存された直後に呼び出される | |
<translate> Define function:</translate> | public static function onLocalUserCreated( $user, $autocreated ) { ... }
|
<translate> Attach hook:</translate> | <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
"Hooks": {
"LocalUserCreated": "MediaWiki\\Extension\\MyExtension\\Hooks::onLocalUserCreated"
}
}
|
<translate> Called from:</translate> | <translate> File(s):</translate> auth/AuthManager.php |
<translate> Interface:</translate> | LocalUserCreatedHook.php |
<translate> For more information about attaching hooks, see <tvar name=1>Manual:フック </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:LocalUserCreated extensions/ja</tvar>.</translate>
詳細
- $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 データベースのトランザクション .
If $wgAutoCreateTempUser is active, this hook is also called when a temporary account is automatically created for a logged-out user.