Manual:User.php
| MediaWiki ファイル: User.php | |
|---|---|
| 場所: | includes/user/ (1.46 以降は includes/User/) |
| ソース コード: | master • 1.44.2 • 1.43.5 • 1.39.15 |
| クラス: | MediaWiki\User\User |
説明
User.php は、利用者固有のすべての設定 (利用者 ID、利用者名、権限、メールアドレス、オプション、最終ログイン日時) をカプセル化する User クラスを実装します。
クライアントのクラス群は、これらのフィールドへのアクセスに getXXX() の形式の関数を使用します。
これらの関数は、利用者がログインしているかどうか、指定したオプションを Cookie が満たしているかどうか、データベースのクエリが必要かどうか、を決定するすべての作業を行います。
通常のページをレンダリングするのに必要な設定の大部分は、データベースへのアクセスを最小化するため Cookie に設定されます。
createAndPromote.php は、User::newFromName()、User::addToDatabase()、User::saveSettings() を使用します。
The User class used to contain password handling, but it was removed with the introduction of AuthManager.
Static factory methods
Note: In modern MediaWiki versions (MW1.35+), it is better to get a UserFactory instance and use the non-static equivalents there.
static newFromName ($name, $validate= 'valid')static newFromId ($id)static newFromConfirmationCode ($code)static newFromSession (WebRequest $request=null)static newFromRow ($row, $data=null)
その他のメソッド
There are a whole host of other ones. 完全な一覧は https://doc.wikimedia.org/mediawiki-core/master/php/classMediaWiki_1_1User_1_1User.html を参照してください。
getId(): Get the user's ID. Returns 0 if the user is anonymous or nonexistent.getName(): Get the user name, or the IP of an anonymous user.getEmail(): 現在の利用者のメールアドレスを返します。:getGroups()Get the list of explicit group memberships this user has. (The implicit * and user groups are not included.)(除去済) UseUserGroupManager->getUserGroups()instead.getRights(): この利用者の権限を返します。
関連項目
- Manual:$wgUser - グローバルの利用者オブジェクト (廃止予定)
- Manual:RequestContext.php - リクエストに関連付けられた User を取得するために使用されます。
- Manual:中央管理 ID
- Manual:コード
- Manual:コーディング規約
- Category:MediaWiki hooks included in User.php