MediaWiki master
|
internal since 1.36 More...
Inherits Stringable, MediaWiki\Permissions\Authority, MediaWiki\User\UserIdentity, and MediaWiki\Mail\UserEmailContact.
Public Member Functions | |||||||
__construct () | |||||||
Lightweight constructor for an anonymous user. | |||||||
& | __get ( $name) | ||||||
__set ( $name, $value) | |||||||
__sleep () | |||||||
__toString () | |||||||
addToDatabase () | |||||||
Add this existing user object to the database. | |||||||
authorizeAction (string $action, ?PermissionStatus $status=null) | |||||||
Authorize an action.This should be used immediately before performing the action.Calling this method may have non-trivial side-effects, such as incrementing a rate limit counter.
| |||||||
authorizeRead (string $action, PageIdentity $target, ?PermissionStatus $status=null) | |||||||
authorizeWrite (string $action, PageIdentity $target, ?PermissionStatus $status=null) | |||||||
canReceiveEmail () | |||||||
Is this user allowed to receive e-mails within limits of current site configuration? | |||||||
canSendEmail () | |||||||
Is this user allowed to send e-mails within limits of current site configuration? | |||||||
changeAuthenticationData (array $data) | |||||||
Changes credentials of the user. | |||||||
checkAndSetTouched () | |||||||
Bump user_touched if it didn't change since this object was loaded. | |||||||
checkPasswordValidity ( $password) | |||||||
Check if this is a valid password for this user. | |||||||
clearInstanceCache ( $reloadFrom=false) | |||||||
Clear various cached data stored in this object. | |||||||
clearSharedCache ( $mode='refresh') | |||||||
Clear user data from memcached. | |||||||
confirmEmail () | |||||||
Mark the e-mail address confirmed. | |||||||
definitelyCan (string $action, PageIdentity $target, ?PermissionStatus $status=null) | |||||||
doLogout () | |||||||
Clear the user's session, and reset the instance cache. | |||||||
equals (?UserIdentity $user) | |||||||
Checks if two user objects point to the same user. | |||||||
getActorId ( $dbwOrWikiId=self::LOCAL) | |||||||
Get the user's actor ID. | |||||||
getBlock ( $freshness=IDBAccessObject::READ_NORMAL, $disableIpBlockExemptChecking=false) | |||||||
Get the block affecting the user, or null if the user is not blocked. | |||||||
getDatePreference () | |||||||
Get the user's preferred date format. | |||||||
getDBTouched () | |||||||
Get the user_touched timestamp field (time of last DB updates) | |||||||
getEditCount () | |||||||
Get the user's edit count. | |||||||
getEditToken ( $salt='', $request=null) | |||||||
Initialize (if necessary) and return a session token value which can be used in edit forms to show that the user's login credentials aren't being hijacked with a foreign form submission. | |||||||
getEditTokenObject ( $salt='', $request=null) | |||||||
Initialize (if necessary) and return a session token value which can be used in edit forms to show that the user's login credentials aren't being hijacked with a foreign form submission. | |||||||
getEmail () | |||||||
Get the user's e-mail address. | |||||||
getEmailAuthenticationTimestamp () | |||||||
Get the timestamp of the user's e-mail authentication. | |||||||
getExperienceLevel () | |||||||
Compute experienced level based on edit count and registration date. | |||||||
getGlobalBlock ( $ip='') | |||||||
Check if user is blocked on all wikis. | |||||||
getId ( $wikiId=self::LOCAL) | |||||||
Get the user's ID. | |||||||
getInstanceForUpdate () | |||||||
Get a new instance of this user that was loaded from the primary DB via a locking read. | |||||||
getName () | |||||||
Get the user name, or the IP of an anonymous user. | |||||||
getRealName () | |||||||
Get the user's real name. | |||||||
getRegistration () | |||||||
Get the timestamp of account creation. | |||||||
getRequest () | |||||||
Get the WebRequest object to use with this object. | |||||||
getTalkPage () | |||||||
Get this user's talk page title. | |||||||
getTitleKey () | |||||||
Get the user's name escaped by underscores. | |||||||
getToken ( $forceCreation=true) | |||||||
Get the user's current token. | |||||||
getTokenFromOption ( $oname) | |||||||
Get a token stored in the preferences (like the watchlist one), resetting it if it's empty (and saving changes). | |||||||
getTouched () | |||||||
Get the user touched timestamp. | |||||||
getUser () | |||||||
getUserPage () | |||||||
Get this user's personal page title. | |||||||
getWikiId () | |||||||
Returns self::LOCAL to indicate the user is associated with the local wiki. | |||||||
idForName ( $flags=IDBAccessObject::READ_NORMAL) | |||||||
If only this user's username is known, and it exists, return the user ID. | |||||||
invalidateCache () | |||||||
Immediately touch the user data cache for this account. | |||||||
invalidateEmail () | |||||||
Invalidate the user's e-mail confirmation, and unauthenticate the e-mail address if it was already confirmed. | |||||||
isAllowed (string $permission, ?PermissionStatus $status=null) | |||||||
Checks whether this authority has the given permission in general. | |||||||
isAllowedAll (... $permissions) | |||||||
Checks whether this authority has any of the given permissions in general. | |||||||
isAllowedAny (... $permissions) | |||||||
Checks whether this authority has any of the given permissions in general. | |||||||
isAllowedToCreateAccount () | |||||||
Get whether the user is allowed to create an account. | |||||||
isAnon () | |||||||
Get whether the user is anonymous. | |||||||
isBlockedFromEmailuser () | |||||||
Get whether the user is blocked from using Special:Emailuser. | |||||||
isBlockedFromUpload () | |||||||
Get whether the user is blocked from using Special:Upload. | |||||||
isBlockedGlobally ( $ip='') | |||||||
Check if user is blocked on all wikis. | |||||||
isBot () | |||||||
isDefinitelyAllowed (string $action, ?PermissionStatus $status=null) | |||||||
Checks whether this authority is allowed to perform the given action.This method performs a thorough check, but does not protect against race conditions. It is intended to be used when a user is intending to perform an action, but has not yet committed to it. For example, when a user visits their preferences page, this method may be used to determine whether the user should have the option to change their email address.This method may apply rate limit checks and evaluate user blocks.
| |||||||
isEmailConfirmationPending () | |||||||
Check whether there is an outstanding request for e-mail confirmation. | |||||||
isEmailConfirmed () | |||||||
Is this user's e-mail address valid-looking and confirmed within limits of the current site configuration? | |||||||
isHidden () | |||||||
Check if user account is hidden. | |||||||
isItemLoaded ( $item, $all='all') | |||||||
Return whether an item has been loaded. | |||||||
isLocked () | |||||||
Check if user account is locked. | |||||||
isNamed () | |||||||
Is the user a normal non-temporary registered user? | |||||||
isNewbie () | |||||||
Determine whether the user is a newbie. | |||||||
isPingLimitable () | |||||||
Is this user subject to rate limiting? | |||||||
isRegistered () | |||||||
Get whether the user is registered. | |||||||
isSafeToLoad () | |||||||
Test if it's safe to load this User object. | |||||||
isSystemUser () | |||||||
Get whether the user is a system user. | |||||||
isTemp () | |||||||
Is the user an autocreated temporary user? | |||||||
isValidPassword ( $password) | |||||||
Is the input a valid password for this user? | |||||||
load ( $flags=IDBAccessObject::READ_NORMAL) | |||||||
Load the user table data for this object from the source given by mFrom. | |||||||
loadDefaults ( $name=false, $actorId=null) | |||||||
Set cached properties to default. | |||||||
loadFromDatabase ( $flags=IDBAccessObject::READ_LATEST) | |||||||
Load user data from the database. | |||||||
loadFromId ( $flags=IDBAccessObject::READ_NORMAL) | |||||||
Load user table data, given mId has already been set. | |||||||
logout () | |||||||
Log this user out. | |||||||
matchEditToken ( $val, $salt='', $request=null, $maxage=null) | |||||||
Check given value against the token value stored in the session. | |||||||
pingLimiter ( $action='edit', $incrBy=1) | |||||||
Primitive rate limits: enforce maximum actions per time period to put a brake on flooding. | |||||||
probablyCan (string $action, PageIdentity $target, ?PermissionStatus $status=null) | |||||||
requiresHTTPS () | |||||||
Determine based on the wiki configuration and the user's options, whether this user must be over HTTPS no matter what. | |||||||
resetTokenFromOption ( $oname) | |||||||
Reset a token stored in the preferences (like the watchlist one). | |||||||
saveSettings () | |||||||
Save this user's settings into the database. | |||||||
sendConfirmationMail ( $type='created') | |||||||
Generate a new e-mail confirmation token and send a confirmation/invalidation mail to the user's given address. | |||||||
sendMail ( $subject, $body, $from=null, $replyto=null) | |||||||
Send an e-mail to this user's account. | |||||||
setActorId (int $actorId) | |||||||
Sets the actor id. | |||||||
setCookies ( $request=null, $secure=null, $rememberMe=false) | |||||||
Persist this user's session (e.g. | |||||||
setEmail (string $str) | |||||||
Set the user's e-mail address. | |||||||
setEmailAuthenticationTimestamp ( $timestamp) | |||||||
Set the e-mail authentication timestamp. | |||||||
setEmailWithConfirmation (string $str) | |||||||
Set the user's e-mail address and send a confirmation mail if needed. | |||||||
setId ( $v) | |||||||
Set the user and reload all fields according to a given ID. | |||||||
setItemLoaded ( $item) | |||||||
Set that an item has been loaded. | |||||||
setName ( $str) | |||||||
Set the user name. | |||||||
setRealName (string $str) | |||||||
Set the user's real name. | |||||||
setToken ( $token=false) | |||||||
Set the random token (used for persistent authentication) Called from loadDefaults() among other places. | |||||||
spreadAnyEditBlock () | |||||||
If this user is logged-in and blocked, block any IP address they've successfully logged in from. | |||||||
toRateLimitSubject () | |||||||
touch () | |||||||
Update the "touched" timestamp for the user. | |||||||
useFilePatrol () | |||||||
Check whether to enable new files patrol features for this user. | |||||||
useNPPatrol () | |||||||
Check whether to enable new pages patrol features for this user. | |||||||
useRCPatrol () | |||||||
Check whether to enable recent changes patrol features for this user. | |||||||
validateCache ( $timestamp) | |||||||
Validate the cache for this account. | |||||||
Public Member Functions inherited from MediaWiki\Permissions\Authority | |||||||
getBlock (int $freshness=IDBAccessObject::READ_NORMAL) | |||||||
Returns any user block affecting the Authority. | |||||||
Public Member Functions inherited from MediaWiki\DAO\WikiAwareEntity | |||||||
assertWiki ( $wikiId) | |||||||
Throws if $wikiId is different from the return value of getWikiId(). | |||||||
Static Public Member Functions | |
static | createNew ( $name, $params=[]) |
Add a user to the database, return the user object. | |
static | findUsersByGroup ( $groups, $limit=5000, $after=null) |
Return the users who are members of the given group(s). | |
static | getQueryInfo () |
Return the tables, fields, and join conditions to be selected to create a new user object. | |
static | getRightDescription ( $right) |
Get the description of a given right as wikitext. | |
static | getRightDescriptionHtml ( $right) |
Get the description of a given right as rendered HTML. | |
static | isWellFormedConfirmationToken (string $token) |
Check if the given email confirmation token is well-formed (to detect mangling by email clients). | |
static | newFatalPermissionDeniedStatus ( $permission) |
Factory function for fatal permission-denied errors. | |
static | newQueryBuilder (IReadableDatabase $db) |
Get a SelectQueryBuilder with the tables, fields and join conditions needed to create a new User object. | |
static | purge ( $dbDomain, $userId) |
static | whoIs ( $id) |
Get the username corresponding to a given user ID. | |
static | whoIsReal ( $id) |
Get the real name of a user given their user ID. | |
newFrom*() static factory methods | |
static | newFromName ( $name, $validate='valid') |
static | newFromId ( $id) |
Static factory method for creation from a given user ID. | |
static | newFromActorId ( $id) |
Static factory method for creation from a given actor ID. | |
static | newFromIdentity (UserIdentity $identity) |
Returns a User object corresponding to the given UserIdentity. | |
static | newFromAnyId ( $userId, $userName, $actorId, $dbDomain=false) |
Static factory method for creation from an ID, name, and/or actor ID. | |
static | newFromConfirmationCode ( $code, $flags=IDBAccessObject::READ_NORMAL) |
Factory method to fetch whichever user has a given email confirmation code. | |
static | newFromSession (?WebRequest $request=null) |
Create a new user object using data from session. | |
static | newFromRow ( $row, $data=null) |
Create a new user object from a user row. | |
static | newSystemUser ( $name, $options=[]) |
Static factory method for creation of a "system" user from username. | |
Public Attributes | |
int null | $mActorId |
Switched from protected to public for use in UserFactory. | |
string | $mEmail |
string null | $mEmailAuthenticated |
string | $mFrom |
Initialization data source if mLoadedItems!==true. | |
int | $mId |
Cache variables. | |
string | $mName |
string | $mRealName |
string | $mTouched |
TS_MW timestamp from the DB. | |
const | INVALID_TOKEN = '*** INVALID ***' |
An invalid string value for the user_token field. | |
const | MAINTENANCE_SCRIPT_USER = 'Maintenance script' |
Username used for various maintenance scripts. | |
const | READ_EXCLUSIVE = IDBAccessObject::READ_EXCLUSIVE |
const | READ_LOCKING = IDBAccessObject::READ_LOCKING |
const | TOKEN_LENGTH = 32 |
Number of characters required for the user_token field. | |
Protected Member Functions | |
confirmationToken (&$expiration) | |
Generate, store, and return a new e-mail confirmation code. | |
confirmationTokenUrl ( $token) | |
Return a URL the user can use to confirm their email address. | |
getCacheKey (WANObjectCache $cache) | |
getTokenUrl ( $page, $token) | |
Internal function to format the e-mail validation/invalidation URLs. | |
invalidationTokenUrl ( $token) | |
Return a URL the user can use to invalidate their email address. | |
loadFromCache () | |
Load user data from shared cache, given mId has already been set. | |
loadFromRow ( $row, $data=null) | |
Initialize this object from a row from the user table. | |
loadFromUserObject ( $user) | |
Load the data for this user object from another user object. | |
makeUpdateConditions (IReadableDatabase $db, array $conditions) | |
Builds update conditions. | |
spreadBlock () | |
If this (non-anonymous) user is blocked, block the IP address they've successfully logged in from. | |
Protected Attributes | |
string null | $mDatePreference |
Lazy-initialized variables, invalidated with clearInstanceCache. | |
string null | $mEmailToken |
string null | $mEmailTokenExpires |
AbstractBlock | $mGlobalBlock |
string false | $mHash |
array bool | $mLoadedItems = [] |
Array with already loaded items or true if all items have been loaded. | |
bool | $mLocked |
string null | $mQuickTouched |
TS_MW timestamp from cache. | |
string null | $mRegistration |
string null | $mToken |
int | $queryFlagsUsed = IDBAccessObject::READ_NORMAL |
IDBAccessObject::READ_* constant bitfield used to load data. | |
Static Protected Attributes | |
static string[] | $mCacheVars |
List of member variables which are saved to the shared cache (memcached). | |
MediaWiki\User\User::__construct | ( | ) |
Lightweight constructor for an anonymous user.
Definition at line 249 of file User.php.
References MediaWiki\User\User\clearInstanceCache().
& MediaWiki\User\User::__get | ( | $name | ) |
Definition at line 270 of file User.php.
References MediaWiki\MediaWikiServices\getInstance(), wfDeprecated(), and wfLogWarning().
MediaWiki\User\User::__set | ( | $name, | |
$value ) |
Definition at line 291 of file User.php.
References MediaWiki\MediaWikiServices\getInstance(), wfDeprecated(), and wfLogWarning().
MediaWiki\User\User::__toString | ( | ) |
MediaWiki\User\User::addToDatabase | ( | ) |
Add this existing user object to the database.
If the user already exists, a fatal status object is returned, and the user object is initialised with the data from the database.
Previously, this function generated a DB error due to a key conflict if the user already existed. Many extension callers use this function in code along the lines of:
$user = User::newFromName( $name ); if ( !$user->isRegistered() ) { $user->addToDatabase(); } // do something with $user...
However, this was vulnerable to a race condition (T18020). By initialising the user object if the user exists, we aim to support this calling sequence as far as possible.
Note that if the user exists, this function will acquire a write lock, so it is still advisable to make the call conditional on isRegistered(), and to commit the transaction after calling.
Definition at line 2565 of file User.php.
References Wikimedia\Rdbms\IDatabase\affectedRows(), Wikimedia\Rdbms\IDatabase\insertId(), Wikimedia\Rdbms\IDatabase\newInsertQueryBuilder(), Wikimedia\Rdbms\IReadableDatabase\newSelectQueryBuilder(), Wikimedia\Rdbms\Platform\ISQLPlatform\timestamp(), and Wikimedia\Rdbms\Platform\ISQLPlatform\timestampOrNull().
Referenced by MediaWiki\Auth\AuthManager\autoCreateUser().
MediaWiki\User\User::authorizeAction | ( | string | $action, |
?PermissionStatus | $status = null ) |
Authorize an action.This should be used immediately before performing the action.Calling this method may have non-trivial side-effects, such as incrementing a rate limit counter.
string | $action | |
PermissionStatus | null | $status | aggregator for failures |
string | $action | |
PermissionStatus | null | $status |
Implements MediaWiki\Permissions\Authority.
MediaWiki\User\User::authorizeRead | ( | string | $action, |
PageIdentity | $target, | ||
?PermissionStatus | $status = null ) |
string | $action | |
PageIdentity | $target | |
PermissionStatus | null | $status |
Implements MediaWiki\Permissions\Authority.
MediaWiki\User\User::authorizeWrite | ( | string | $action, |
PageIdentity | $target, | ||
?PermissionStatus | $status = null ) |
string | $action | |
PageIdentity | $target | |
PermissionStatus | null | $status |
Implements MediaWiki\Permissions\Authority.
MediaWiki\User\User::canReceiveEmail | ( | ) |
Is this user allowed to receive e-mails within limits of current site configuration?
Definition at line 3031 of file User.php.
References MediaWiki\User\Options\UserOptionsLookup\getOption().
MediaWiki\User\User::canSendEmail | ( | ) |
Is this user allowed to send e-mails within limits of current site configuration?
Definition at line 3018 of file User.php.
References wfDeprecated().
MediaWiki\User\User::changeAuthenticationData | ( | array | $data | ) |
Changes credentials of the user.
This is a convenience wrapper around AuthManager::changeAuthenticationData. Note that this can return a status that isOK() but not isGood() on certain types of failures, e.g. when no provider handled the change.
array | $data | A set of authentication data in fieldname => value format. This is the same data you would pass the changeauthenticationdata API - 'username', 'password' etc. |
MediaWiki\User\User::checkAndSetTouched | ( | ) |
Bump user_touched if it didn't change since this object was loaded.
On success, the mTouched field is updated. The user serialization cache is always cleared.
Definition at line 1280 of file User.php.
References $success, and MediaWiki\MediaWikiServices\getInstance().
MediaWiki\User\User::checkPasswordValidity | ( | $password | ) |
Check if this is a valid password for this user.
Returns a Status object with a set of messages describing problems with the password. If the return status is fatal, the action should be refused and the password should not be checked at all (this is mainly meant for DoS mitigation). If the return value is OK but not good, the password can be checked, but the user should not be able to set their password to this. The value of the returned Status object will be an array which can have the following fields:
string | $password | Desired password |
Definition at line 967 of file User.php.
References MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\MainConfigNames\PasswordPolicy.
MediaWiki\User\User::clearInstanceCache | ( | $reloadFrom = false | ) |
Clear various cached data stored in this object.
The cache of the user table data (i.e. self::$mCacheVars) is not cleared unless $reloadFrom is given.
bool | string | $reloadFrom | Reload user and user_groups table data from a given source. May be "name", "id", "actor", "defaults", "session", or false for no reload. |
Definition at line 1318 of file User.php.
References $wgFullyInitialised, and MediaWiki\MediaWikiServices\getInstance().
Referenced by MediaWiki\User\User\__construct().
MediaWiki\User\User::clearSharedCache | ( | $mode = 'refresh' | ) |
Clear user data from memcached.
Use after applying updates to the database; caller's responsibility to update user_touched if appropriate.
Called implicitly from invalidateCache() and saveSettings().
string | $mode | Use 'refresh' to clear now or 'changed' to clear before DB commit |
Definition at line 1687 of file User.php.
References getCacheKey().
|
protected |
Generate, store, and return a new e-mail confirmation code.
A hash (unsalted, since it's used as a key) is stored.
string | &$expiration | Accepts the expiration time |
Definition at line 2904 of file User.php.
References wfTimestamp().
|
protected |
MediaWiki\User\User::confirmEmail | ( | ) |
Mark the e-mail address confirmed.
Definition at line 2973 of file User.php.
References wfTimestampNow().
|
static |
Add a user to the database, return the user object.
string | $name | Username to add |
array | $params | Array of Strings Non-default parameters to save to the database as user_* fields:
|
Definition at line 2470 of file User.php.
References $params.
MediaWiki\User\User::definitelyCan | ( | string | $action, |
PageIdentity | $target, | ||
?PermissionStatus | $status = null ) |
string | $action | |
PageIdentity | $target | |
PermissionStatus | null | $status |
Implements MediaWiki\Permissions\Authority.
MediaWiki\User\User::doLogout | ( | ) |
MediaWiki\User\User::equals | ( | ?UserIdentity | $user | ) |
Checks if two user objects point to the same user.
UserIdentity | null | $user |
Implements MediaWiki\User\UserIdentity.
|
static |
Return the users who are members of the given group(s).
In case of multiple groups, users who are members of at least one of them are returned.
string | array | $groups | A single group name or an array of group names |
int | $limit | Max number of users to return. The actual limit will never exceed 5000 records; larger values are ignored. |
int | null | $after | ID the user to start after |
Definition at line 914 of file User.php.
References MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\User\UserArray\newFromIDs().
MediaWiki\User\User::getActorId | ( | $dbwOrWikiId = self::LOCAL | ) |
Get the user's actor ID.
IDatabase | string | false | $dbwOrWikiId | Deprecated since 1.36. If a database connection is passed, a new actor ID is assigned if needed. ActorNormalization::acquireActorId() should be used for that purpose instead. |
PreconditionException | if $dbwOrWikiId is a string and does not match the local wiki |
Definition at line 1612 of file User.php.
References wfDeprecatedMsg().
MediaWiki\User\User::getBlock | ( | $freshness = IDBAccessObject::READ_NORMAL, | |
$disableIpBlockExemptChecking = false ) |
Get the block affecting the user, or null if the user is not blocked.
int | bool | $freshness | One of the IDBAccessObject::READ_XXX constants. For backwards compatibility, a boolean is also accepted, with true meaning READ_NORMAL and false meaning READ_LATEST. |
bool | $disableIpBlockExemptChecking | This is used internally to prevent a infinite recursion with autopromote. See T270145. |
Definition at line 1418 of file User.php.
Referenced by Action\checkCanExecute(), MediaWiki\SpecialPage\FormSpecialPage\checkExecutePermissions(), and MediaWiki\Block\BlockManager\trackBlockWithCookie().
|
protected |
WANObjectCache | $cache |
Definition at line 483 of file User.php.
References MediaWiki\MediaWikiServices\getInstance(), and Wikimedia\ObjectCache\WANObjectCache\makeGlobalKey().
MediaWiki\User\User::getDatePreference | ( | ) |
Get the user's preferred date format.
Definition at line 2057 of file User.php.
References $wgLang, and MediaWiki\User\Options\UserOptionsLookup\getOption().
MediaWiki\User\User::getDBTouched | ( | ) |
MediaWiki\User\User::getEditCount | ( | ) |
Get the user's edit count.
Definition at line 2100 of file User.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
MediaWiki\User\User::getEditToken | ( | $salt = '', | |
$request = null ) |
Initialize (if necessary) and return a session token value which can be used in edit forms to show that the user's login credentials aren't being hijacked with a foreign form submission.
The $salt for 'edit' and 'csrf' tokens is the default (empty string).
string | string[] | $salt | Optional function-specific data for hashing |
WebRequest | null | $request | WebRequest object to use, or null to use the global request |
MediaWiki\User\User::getEditTokenObject | ( | $salt = '', | |
$request = null ) |
Initialize (if necessary) and return a session token value which can be used in edit forms to show that the user's login credentials aren't being hijacked with a foreign form submission.
string | string[] | $salt | Optional function-specific data for hashing |
WebRequest | null | $request | WebRequest object to use, or null to use the global request |
Definition at line 2755 of file User.php.
Referenced by MediaWiki\Api\ApiQueryTokens\getToken().
MediaWiki\User\User::getEmail | ( | ) |
Get the user's e-mail address.
Implements MediaWiki\Mail\UserEmailContact.
Definition at line 1884 of file User.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
MediaWiki\User\User::getEmailAuthenticationTimestamp | ( | ) |
Get the timestamp of the user's e-mail authentication.
Definition at line 1897 of file User.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
MediaWiki\User\User::getExperienceLevel | ( | ) |
Compute experienced level based on edit count and registration date.
Definition at line 2229 of file User.php.
References wfTimestamp().
MediaWiki\User\User::getGlobalBlock | ( | $ip = '' | ) |
Check if user is blocked on all wikis.
Do not use for actual edit permission checks! This is intended for quick UI checks.
string | $ip | IP address, uses current client if none given |
MediaWiki\User\User::getId | ( | $wikiId = self::LOCAL | ) |
Get the user's ID.
string | false | $wikiId | The wiki ID expected by the caller. |
Implements MediaWiki\User\UserIdentity.
Definition at line 1533 of file User.php.
Referenced by UploadFromChunks\__construct(), MediaWiki\Auth\AuthManager\autoCreateUser(), MediaWiki\Auth\AuthManager\beginAccountLink(), and CreditsAction\link().
MediaWiki\User\User::getInstanceForUpdate | ( | ) |
Get a new instance of this user that was loaded from the primary DB via a locking read.
Use this instead of the main context User when updating that user. This avoids races where that user was loaded from a replica DB or even the primary DB but without proper locks.
MediaWiki\User\User::getName | ( | ) |
Get the user name, or the IP of an anonymous user.
Implements MediaWiki\User\UserIdentity.
Definition at line 1566 of file User.php.
Referenced by MediaWiki\User\User\__toString(), MediaWiki\Auth\AuthManager\autoCreateUser(), MediaWiki\Auth\AuthManager\beginAccountLink(), MediaWiki\User\PasswordReset\execute(), MediaWiki\Preferences\DefaultPreferencesFactory\generateSkinOptions(), MediaWiki\Specials\SpecialEmailUser\getFormFields(), MediaWiki\Specials\SpecialDeletedContributions\getUserLinks(), MediaWiki\User\PasswordReset\isAllowed(), CreditsAction\link(), MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\skinPreferences(), MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProvider\tryReset(), and CreditsAction\userLink().
|
static |
Return the tables, fields, and join conditions to be selected to create a new user object.
$table
to IDatabase->select()
or SelectQueryBuilder::tables
$vars
to IDatabase->select()
or SelectQueryBuilder::fields
$join_conds
to IDatabase->select()
or SelectQueryBuilder::joinConds
MediaWiki\User\User::getRealName | ( | ) |
Get the user's real name.
Implements MediaWiki\Mail\UserEmailContact.
Definition at line 1981 of file User.php.
Referenced by CreditsAction\link(), MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences(), and CreditsAction\userLink().
MediaWiki\User\User::getRegistration | ( | ) |
Get the timestamp of account creation.
Definition at line 3081 of file User.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
MediaWiki\User\User::getRequest | ( | ) |
Get the WebRequest object to use with this object.
Definition at line 2220 of file User.php.
Referenced by MediaWiki\User\PasswordReset\execute(), and MediaWiki\Block\BlockManager\trackBlockWithCookie().
|
static |
Get the description of a given right as wikitext.
string | $right | Right to query |
Definition at line 3096 of file User.php.
References wfMessage().
|
static |
Get the description of a given right as rendered HTML.
string | $right | Right to query |
Definition at line 3109 of file User.php.
References wfMessage().
MediaWiki\User\User::getTalkPage | ( | ) |
MediaWiki\User\User::getTitleKey | ( | ) |
Get the user's name escaped by underscores.
Definition at line 1658 of file User.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
MediaWiki\User\User::getToken | ( | $forceCreation = true | ) |
MediaWiki\User\User::getTokenFromOption | ( | $oname | ) |
Get a token stored in the preferences (like the watchlist one), resetting it if it's empty (and saving changes).
string | $oname | The option name to retrieve the token from |
Definition at line 2008 of file User.php.
References MediaWiki\User\Options\UserOptionsLookup\getOption().
|
protected |
Internal function to format the e-mail validation/invalidation URLs.
This uses a quickie hack to use the hardcoded English names of the Special: pages, for ASCII safety.
string | $page | Special page |
string | $token |
Definition at line 2960 of file User.php.
References NS_MAIN.
MediaWiki\User\User::getTouched | ( | ) |
Get the user touched timestamp.
Use this value only to validate caches via inequalities such as in the case of HTTP If-Modified-Since response logic
Definition at line 1757 of file User.php.
References wfTimestamp().
MediaWiki\User\User::getUser | ( | ) |
Implements MediaWiki\Permissions\Authority.
MediaWiki\User\User::getUserPage | ( | ) |
Get this user's personal page title.
Definition at line 2717 of file User.php.
References NS_USER.
Referenced by MediaWiki\Auth\AuthManager\autoCreateUser(), and MediaWiki\Specials\SpecialEmailUser\getFormFields().
MediaWiki\User\User::getWikiId | ( | ) |
Returns self::LOCAL to indicate the user is associated with the local wiki.
Implements MediaWiki\DAO\WikiAwareEntity.
MediaWiki\User\User::idForName | ( | $flags = IDBAccessObject::READ_NORMAL | ) |
MediaWiki\User\User::invalidateCache | ( | ) |
MediaWiki\User\User::invalidateEmail | ( | ) |
|
protected |
MediaWiki\User\User::isAllowed | ( | string | $permission, |
?PermissionStatus | $status = null ) |
Checks whether this authority has the given permission in general.
For some permissions, exceptions may exist, both positive and negative, on a per-target basis. This method offers a fast, lightweight check, but may produce false positives. It is intended for determining which UI elements should be offered to the user.
This method will not apply rate limit checks or evaluate user blocks.
string | $permission | |
PermissionStatus | null | $status |
Implements MediaWiki\Permissions\Authority.
Definition at line 2171 of file User.php.
Referenced by WatchAction\checkCanExecute(), MediaWiki\Preferences\DefaultPreferencesFactory\editingPreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\getForm(), MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\renderingPreferences(), and MediaWiki\Preferences\DefaultPreferencesFactory\watchlistPreferences().
MediaWiki\User\User::isAllowedAll | ( | $permissions | ) |
Checks whether this authority has any of the given permissions in general.
Implementations must ensure that this method returns false if isAllowed would return false for any of the given permissions. Calling isAllowedAll() with one parameter must be equivalent to calling isAllowed(). Calling isAllowedAny() with no parameter is not allowed.
string | ...$permissions Permissions to test. At least one must be given. |
Implements MediaWiki\Permissions\Authority.
MediaWiki\User\User::isAllowedAny | ( | $permissions | ) |
Checks whether this authority has any of the given permissions in general.
Implementations must ensure that this method returns true if isAllowed would return true for any of the given permissions. Calling isAllowedAny() with one parameter must be equivalent to calling isAllowed(). Calling isAllowedAny() with no parameter is not allowed.
string | ...$permissions Permissions to test. At least one must be given. |
Implements MediaWiki\Permissions\Authority.
Definition at line 2163 of file User.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\watchlistPreferences().
MediaWiki\User\User::isAllowedToCreateAccount | ( | ) |
MediaWiki\User\User::isAnon | ( | ) |
Get whether the user is anonymous.
Definition at line 2122 of file User.php.
Referenced by CreditsAction\link(), MediaWiki\Session\UserInfo\newFromId(), MediaWiki\Block\BlockManager\trackBlockWithCookie(), and CreditsAction\userLink().
MediaWiki\User\User::isBlockedFromEmailuser | ( | ) |
Get whether the user is blocked from using Special:Emailuser.
Definition at line 2687 of file User.php.
References wfDeprecated().
MediaWiki\User\User::isBlockedFromUpload | ( | ) |
MediaWiki\User\User::isBlockedGlobally | ( | $ip = '' | ) |
Check if user is blocked on all wikis.
Do not use for actual edit permission checks! This is intended for quick UI checks.
string | $ip | IP address, uses current client if none given |
Definition at line 1463 of file User.php.
References wfDeprecated().
MediaWiki\User\User::isBot | ( | ) |
Definition at line 2130 of file User.php.
Referenced by MediaWiki\Api\getWatchlistValue().
MediaWiki\User\User::isDefinitelyAllowed | ( | string | $action, |
?PermissionStatus | $status = null ) |
Checks whether this authority is allowed to perform the given action.This method performs a thorough check, but does not protect against race conditions. It is intended to be used when a user is intending to perform an action, but has not yet committed to it. For example, when a user visits their preferences page, this method may be used to determine whether the user should have the option to change their email address.This method may apply rate limit checks and evaluate user blocks.
string | $action | |
PermissionStatus | null | $status | aggregator for failures |
string | $action | |
PermissionStatus | null | $status |
Implements MediaWiki\Permissions\Authority.
MediaWiki\User\User::isEmailConfirmationPending | ( | ) |
Check whether there is an outstanding request for e-mail confirmation.
Definition at line 3065 of file User.php.
References wfTimestamp().
MediaWiki\User\User::isEmailConfirmed | ( | ) |
Is this user's e-mail address valid-looking and confirmed within limits of the current site configuration?
Implements MediaWiki\Mail\UserEmailContact.
MediaWiki\User\User::isHidden | ( | ) |
MediaWiki\User\User::isItemLoaded | ( | $item, | |
$all = 'all' ) |
Return whether an item has been loaded.
string | $item | Item to check. Current possibilities:
|
string | $all | 'all' to check if the whole object has been loaded or any other string to check if only the item is available (e.g. for optimisation) |
MediaWiki\User\User::isLocked | ( | ) |
MediaWiki\User\User::isNamed | ( | ) |
Is the user a normal non-temporary registered user?
Implements MediaWiki\Permissions\Authority.
MediaWiki\User\User::isNewbie | ( | ) |
MediaWiki\User\User::isPingLimitable | ( | ) |
Is this user subject to rate limiting?
Definition at line 1368 of file User.php.
References MediaWiki\MediaWikiServices\getInstance().
MediaWiki\User\User::isRegistered | ( | ) |
Get whether the user is registered.
Implements MediaWiki\Permissions\Authority.
Definition at line 2114 of file User.php.
Referenced by MediaWiki\Auth\AuthManager\beginAccountLink(), WatchAction\checkCanExecute(), UppercaseTitlesForUnicodeTransition\execute(), and MediaWiki\Language\LanguageConverter\getUserVariant().
MediaWiki\User\User::isSafeToLoad | ( | ) |
Test if it's safe to load this User object.
You should typically check this before using $wgUser or RequestContext::getUser in a method that might be called before the system has been fully initialized. If the object is unsafe, you should use an anonymous user: \code $user = $wgUser->isSafeToLoad() ? $wgUser : new User; \endcode
Definition at line 331 of file User.php.
References $wgFullyInitialised.
Referenced by MediaWiki\Language\LanguageConverter\getUserVariant(), and MediaWiki\Block\BlockManager\trackBlockWithCookie().
MediaWiki\User\User::isSystemUser | ( | ) |
MediaWiki\User\User::isTemp | ( | ) |
Is the user an autocreated temporary user?
Implements MediaWiki\Permissions\Authority.
Definition at line 3377 of file User.php.
Referenced by WatchAction\checkCanExecute().
MediaWiki\User\User::isValidPassword | ( | $password | ) |
|
static |
MediaWiki\User\User::load | ( | $flags = IDBAccessObject::READ_NORMAL | ) |
Load the user table data for this object from the source given by mFrom.
int | $flags | IDBAccessObject::READ_* constant bitfield |
Definition at line 348 of file User.php.
References $wgFullyInitialised, and MediaWiki\MediaWikiServices\getInstance().
Referenced by MediaWiki\Session\UserInfo\newFromId().
MediaWiki\User\User::loadDefaults | ( | $name = false, | |
$actorId = null ) |
Set cached properties to default.
string | false | $name | |
int | null | $actorId |
Definition at line 1006 of file User.php.
References wfTimestamp().
|
protected |
Load user data from shared cache, given mId has already been set.
Definition at line 496 of file User.php.
References $wgFullyInitialised, getCacheKey(), Wikimedia\Rdbms\Database\getCacheSetOptions(), MediaWiki\MediaWikiServices\getInstance(), wfDebug(), and wfTimestamp().
MediaWiki\User\User::loadFromDatabase | ( | $flags = IDBAccessObject::READ_LATEST | ) |
Load user data from the database.
$this->mId must be set, this is how the user is identified.
int | $flags | IDBAccessObject::READ_* constant bitfield |
Definition at line 1092 of file User.php.
References MediaWiki\MediaWikiServices\getInstance().
MediaWiki\User\User::loadFromId | ( | $flags = IDBAccessObject::READ_NORMAL | ) |
Load user table data, given mId has already been set.
int | $flags | IDBAccessObject::READ_* constant bitfield |
Definition at line 442 of file User.php.
Referenced by MediaWiki\Auth\AuthManager\autoCreateUser().
|
protected |
Initialize this object from a row from the user table.
stdClass | $row | Row from the user table to load. |
array | null | $data | Further user data to load into the object |
user_groups Array of arrays or stdClass result rows out of the user_groups table. Previously you were supposed to pass an array of strings here, but we also need expiry info nowadays, so an array of strings is ignored.
Definition at line 1138 of file User.php.
References MediaWiki\MediaWikiServices\getInstance(), wfTimestamp(), and wfTimestampOrNull().
Referenced by MediaWiki\User\User\newFromRow().
|
protected |
|
protected |
Builds update conditions.
Additional conditions may be added to $conditions to protected against race conditions using a compare-and-set (CAS) mechanism based on comparing $this->mTouched with the user_touched field.
IReadableDatabase | $db | |
array | $conditions | WHERE conditions for use with Database::update |
Definition at line 1261 of file User.php.
References Wikimedia\Rdbms\Platform\ISQLPlatform\timestamp().
MediaWiki\User\User::matchEditToken | ( | $val, | |
$salt = '', | |||
$request = null, | |||
$maxage = null ) |
Check given value against the token value stored in the session.
A match should confirm that the form was submitted from the user's own login session, not a form submission from a third-party site.
string | null | $val | Input value to compare |
string | array | $salt | Optional function-specific data for hashing |
WebRequest | null | $request | Object to use, or null to use the global request |
int | null | $maxage | Fail tokens older than this, in seconds |
|
static |
Factory function for fatal permission-denied errors.
string | $permission | User right required |
|
static |
Static factory method for creation from a given actor ID.
int | $id | Valid actor ID |
Definition at line 631 of file User.php.
References MediaWiki\MediaWikiServices\getInstance().
|
static |
Static factory method for creation from an ID, name, and/or actor ID.
This does not check that the ID, name, and actor ID all correspond to the same user.
int | null | $userId | User ID, if known |
string | null | $userName | User name, if known |
int | null | $actorId | Actor ID, if known |
string | false | $dbDomain | remote wiki to which the User/Actor ID applies, or false if none |
Definition at line 680 of file User.php.
References MediaWiki\MediaWikiServices\getInstance().
|
static |
Factory method to fetch whichever user has a given email confirmation code.
This code is generated when an account is created or its e-mail address has changed.
If the code is invalid or has expired, returns NULL.
string | $code | Confirmation code |
int | $flags | IDBAccessObject::READ_* bitfield |
Definition at line 701 of file User.php.
References MediaWiki\MediaWikiServices\getInstance().
|
static |
Static factory method for creation from a given user ID.
int | $id | Valid user ID |
Definition at line 614 of file User.php.
References MediaWiki\MediaWikiServices\getInstance().
Referenced by MediaWiki\Session\UserInfo\newFromId().
|
static |
Returns a User object corresponding to the given UserIdentity.
UserIdentity | $identity |
Definition at line 650 of file User.php.
References MediaWiki\MediaWikiServices\getInstance().
|
static |
This is slightly less efficient than newFromId(), so use newFromId() if you have both an ID and a name handy.
string | $name | Username, validated by Title::newFromText() |
string | bool | $validate | Validate username.Type of validation to use:
|
Definition at line 580 of file User.php.
References MediaWiki\MediaWikiServices\getInstance(), MediaWiki\User\UserRigorOptions\RIGOR_CREATABLE, MediaWiki\User\UserRigorOptions\RIGOR_NONE, MediaWiki\User\UserRigorOptions\RIGOR_USABLE, and MediaWiki\User\UserRigorOptions\RIGOR_VALID.
Referenced by RenameUsersMatchingPattern\execute(), and MediaWiki\Session\UserInfo\newFromName().
|
static |
Create a new user object from a user row.
The row should have the following fields from the user table in it:
stdClass | $row | A row from the user table |
array | null | $data | Further data to load into the object (see User::loadFromRow for valid keys) |
Definition at line 736 of file User.php.
References MediaWiki\User\User\loadFromRow().
Referenced by MediaWiki\User\UserArrayFromResult\setCurrent().
|
static |
|
static |
Get a SelectQueryBuilder with the tables, fields and join conditions needed to create a new User object.
The return value is a plain SelectQueryBuilder, not a UserSelectQueryBuilder. That way, there is no need for an ActorStore.
Definition at line 3160 of file User.php.
References Wikimedia\Rdbms\IReadableDatabase\newSelectQueryBuilder().
Referenced by MediaWiki\User\UserArray\newFromIDs(), and MediaWiki\User\UserArray\newFromNames().
|
static |
Static factory method for creation of a "system" user from username.
A "system" user is an account that's used to attribute logged actions taken by MediaWiki itself, as opposed to a bot or human user. Examples might include the 'Maintenance script' or 'Conversion script' accounts used by various scripts in the maintenance/ directory or accounts such as 'MediaWiki message delivery' used by the MassMessage extension.
This can optionally create the user if it doesn't exist, and "steal" the account if it does exist.
"Stealing" an existing user is intended to make it impossible for normal authentication processes to use the account, effectively disabling the account for normal use:
System users should usually be listed in $wgReservedUsernames.
string | $name | Username |
array | $options | Options are:
|
Definition at line 786 of file User.php.
References MediaWiki\MediaWikiServices\getInstance(), MediaWiki\User\UserRigorOptions\RIGOR_CREATABLE, MediaWiki\User\UserRigorOptions\RIGOR_NONE, MediaWiki\User\UserRigorOptions\RIGOR_USABLE, MediaWiki\User\UserRigorOptions\RIGOR_VALID, and wfDeprecatedMsg().
MediaWiki\User\User::pingLimiter | ( | $action = 'edit', | |
$incrBy = 1 ) |
Primitive rate limits: enforce maximum actions per time period to put a brake on flooding.
The method generates both a generic profiling point and a per action one (suffix being "-$action").
string | $action | Action to enforce; 'edit' if unspecified |
int | $incrBy | Positive amount to increment counter by [defaults to 1] |
Definition at line 1389 of file User.php.
Referenced by MediaWiki\User\PasswordReset\execute().
MediaWiki\User\User::probablyCan | ( | string | $action, |
PageIdentity | $target, | ||
?PermissionStatus | $status = null ) |
string | $action | |
PageIdentity | $target | |
PermissionStatus | null | $status |
Implements MediaWiki\Permissions\Authority.
|
static |
string | $dbDomain | |
int | $userId |
Definition at line 472 of file User.php.
References MediaWiki\MediaWikiServices\getInstance().
MediaWiki\User\User::requiresHTTPS | ( | ) |
MediaWiki\User\User::resetTokenFromOption | ( | $oname | ) |
Reset a token stored in the preferences (like the watchlist one).
Does not save user's preferences (similarly to UserOptionsManager::setOption()).
string | $oname | The option name to reset the token in |
MediaWiki\User\User::saveSettings | ( | ) |
Save this user's settings into the database.
Definition at line 2358 of file User.php.
References Wikimedia\Rdbms\IDatabase\affectedRows(), Wikimedia\Rdbms\IDatabase\newUpdateQueryBuilder(), Wikimedia\Rdbms\Platform\ISQLPlatform\timestamp(), and Wikimedia\Rdbms\Platform\ISQLPlatform\timestampOrNull().
Referenced by MediaWiki\Auth\AuthManager\autoCreateUser(), MediaWiki\Session\SessionManager\invalidateSessionsForUser(), and MediaWiki\Session\SessionBackend\save().
MediaWiki\User\User::sendConfirmationMail | ( | $type = 'created' | ) |
Generate a new e-mail confirmation token and send a confirmation/invalidation mail to the user's given address.
string | $type | Message to send, either "created", "changed" or "set" |
Definition at line 2808 of file User.php.
References $url, $wgLang, and wfMessage().
MediaWiki\User\User::sendMail | ( | $subject, | |
$body, | |||
$from = null, | |||
$replyto = null ) |
Send an e-mail to this user's account.
Does not check for confirmed status or validity.
string | $subject | Message subject |
string | string[] | $body | Message body or array containing keys text and html |
User | null | $from | Optional sending user; if unspecified, default $wgPasswordSender will be used. |
MailAddress | null | $replyto | Reply-To address |
Definition at line 2863 of file User.php.
References wfMessage().
MediaWiki\User\User::setActorId | ( | int | $actorId | ) |
Sets the actor id.
For use by ActorStore only. Should be removed once callers of getActorId() have been migrated to using ActorNormalization.
int | $actorId |
MediaWiki\User\User::setCookies | ( | $request = null, | |
$secure = null, | |||
$rememberMe = false ) |
Persist this user's session (e.g.
set cookies)
WebRequest | null | $request | WebRequest object to use; the global request will be used if null is passed. |
bool | null | $secure | Whether to force secure/insecure cookies or use default |
bool | $rememberMe | Whether to add a Token cookie for elongated sessions |
MediaWiki\User\User::setEmail | ( | string | $str | ) |
MediaWiki\User\User::setEmailAuthenticationTimestamp | ( | $timestamp | ) |
MediaWiki\User\User::setEmailWithConfirmation | ( | string | $str | ) |
Set the user's e-mail address and send a confirmation mail if needed.
string | $str | New e-mail address |
Definition at line 1925 of file User.php.
References wfMessage().
MediaWiki\User\User::setId | ( | $v | ) |
Set the user and reload all fields according to a given ID.
int | $v | User ID to reload |
Definition at line 1557 of file User.php.
Referenced by MediaWiki\Auth\AuthManager\autoCreateUser().
MediaWiki\User\User::setItemLoaded | ( | $item | ) |
MediaWiki\User\User::setName | ( | $str | ) |
Set the user name.
This does not reload fields from the database according to the given name. Rather, it is used to create a temporary "nonexistent user" for later addition to the database. It can also be used to set the IP address for an anonymous user to something other than the current remote IP.
string | $str | New user name to set |
MediaWiki\User\User::setRealName | ( | string | $str | ) |
MediaWiki\User\User::setToken | ( | $token = false | ) |
Set the random token (used for persistent authentication) Called from loadDefaults() among other places.
string | false | $token | If specified, set the token to this value |
Definition at line 1868 of file User.php.
Referenced by MediaWiki\Session\SessionManager\invalidateSessionsForUser().
MediaWiki\User\User::spreadAnyEditBlock | ( | ) |
|
protected |
MediaWiki\User\User::toRateLimitSubject | ( | ) |
MediaWiki\User\User::touch | ( | ) |
Update the "touched" timestamp for the user.
This is useful on various login/logout events when making sure that a browser or proxy that has multiple tenants does not suffer cache pollution where the new user sees the old users content. The value of getTouched() is checked when determining 304 vs 200 responses. Unlike invalidateCache(), this preserves the User object cache and avoids database writes.
MediaWiki\User\User::useFilePatrol | ( | ) |
Check whether to enable new files patrol features for this user.
Definition at line 2204 of file User.php.
Referenced by ChangesList\isUnpatrolled().
MediaWiki\User\User::useNPPatrol | ( | ) |
Check whether to enable new pages patrol features for this user.
Definition at line 2189 of file User.php.
Referenced by ChangesList\isUnpatrolled(), and MediaWiki\Preferences\DefaultPreferencesFactory\rcPreferences().
MediaWiki\User\User::useRCPatrol | ( | ) |
Check whether to enable recent changes patrol features for this user.
Definition at line 2179 of file User.php.
Referenced by ChangesList\isUnpatrolled(), MediaWiki\Preferences\DefaultPreferencesFactory\rcPreferences(), and MediaWiki\Preferences\DefaultPreferencesFactory\watchlistPreferences().
MediaWiki\User\User::validateCache | ( | $timestamp | ) |
|
static |
Get the username corresponding to a given user ID.
int | $id | User ID |
Definition at line 887 of file User.php.
References MediaWiki\MediaWikiServices\getInstance().
|
static |
Get the real name of a user given their user ID.
int | $id | User ID |
Definition at line 899 of file User.php.
References MediaWiki\MediaWikiServices\getInstance().
int null MediaWiki\User\User::$mActorId |
|
staticprotected |
List of member variables which are saved to the shared cache (memcached).
Any operation which changes the corresponding database fields must call a cache-clearing function.
|
protected |
|
protected |
string MediaWiki\User\User::$mFrom |
Initialization data source if mLoadedItems!==true.
May be one of:
Use the User::newFrom*() family of functions to set this.
|
protected |
|
protected |
|
protected |
string MediaWiki\User\User::$mTouched |
|
protected |
const MediaWiki\User\User::INVALID_TOKEN = '*** INVALID ***' |
const MediaWiki\User\User::MAINTENANCE_SCRIPT_USER = 'Maintenance script' |
const MediaWiki\User\User::READ_EXCLUSIVE = IDBAccessObject::READ_EXCLUSIVE |
const MediaWiki\User\User::READ_LOCKING = IDBAccessObject::READ_LOCKING |
const MediaWiki\User\User::TOKEN_LENGTH = 32 |