매뉴얼:User.php
미디어위키 파일: User.php | |
---|---|
위치: | includes/user/ |
소스 코드: | master • 1.42.3 • 1.41.4 • 1.39.10 |
클래스: | MediaWiki\User\User |
설명
User.php implements the User class, which encapsulates all of the user-specific settings (user_id, name, rights, email address, options, last login time).
Client classes use the getXXX()
functions to access these fields.
These functions do all the work of determining whether the user is logged in, whether the requested option can be satisfied from cookies or whether a database query is needed.
Most of the settings needed for rendering normal pages are set in the cookie to minimize use of the database.
createAndPromote.php uses User::newFromName()
, User::addToDatabase()
, and 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/classMediaWiki_1_1User_1_1User.html을 참고하세요.
getId()
: Get the user's ID. Returns 0 if the user is anonymous or nonexistent.getName()
: 사용자의 이름이나 익명 유저의 IP 주소를 가져오기.getEmail()
: 사용자의 이메일 계정을 가져오기.getGroups()
: Get the list of explicit group memberships this user has. (The implicit * and user groups are not included.)getRights()
: 사용가가 가졌던 권리를 가져오기.
같이 보기
- Manual:$wgUser - global user object (deprecated)
- Manual:RequestContext.php - Used to get the User associated with a request.
- Manual:Central ID
- Manual:Code
- Manual:Coding conventions
- Category:MediaWiki hooks included in User.php