Manual:User.php

This page is a translated version of the page Manual:User.php and the translation is 57% complete.

説明

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

  • 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/classUser.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(): Get the user's email address.
  • getGroups(): Get the list of explicit group memberships this user has. (The implicit * and user groups are not included.)
  • getRights(): Get the permissions this user has.

関連項目