Manual:Hooks/LocalUserCreated/ja

This page is a translated version of the page Manual:Hooks/LocalUserCreated and the translation is 29% complete.
LocalUserCreated
バージョン 1.26.0 から利用可能
ローカルユーザーが作成され、データベースに保存された直後に呼び出される
関数の定義:
public static function onLocalUserCreated( $user, $autocreated ) { ... }
フックのアタッチ: extension.json 内:
{
	"Hooks": {
		"LocalUserCreated": "MediaWiki\\Extension\\MyExtension\\Hooks::onLocalUserCreated"
	}
}
呼び出し元: ファイル: auth/AuthManager.php
インターフェイス: LocalUserCreatedHook.php

フックの設定についての詳細情報は Manual:フック を参照してください。
このフックを使用する拡張機能の例については、Category:LocalUserCreated extensions/ja を参照してください。


詳細

  • $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.


関連項目