MediaWiki
master
|
The User object encapsulates all of the user-specific settings (user_id, name, rights, email address, options, last login time). More...
Public Member Functions | |
__construct () | |
Lightweight constructor for an anonymous user. More... | |
& | __get ( $name) |
__set ( $name, $value) | |
__sleep () | |
__toString () | |
addAutopromoteOnceGroups ( $event) | |
Add the user to the group if he/she meets given criteria. More... | |
addGroup ( $group, $expiry=null) | |
Add the user to the given group. More... | |
addToDatabase () | |
Add this existing user object to the database. More... | |
addWatch ( $title, $checkRights=self::CHECK_USER_RIGHTS, ?string $expiry=null) | |
Watch an article. More... | |
authorizeRead (string $action, PageIdentity $target, PermissionStatus $status=null) | |
@unstable this is a part of the Authority experiment and should not be used yet. More... | |
authorizeWrite (string $action, PageIdentity $target, PermissionStatus $status=null) | |
@unstable this is a part of the Authority experiment and should not be used yet. More... | |
blockedBy () | |
If user is blocked, return the name of the user who placed the block. More... | |
blockedFor () | |
If user is blocked, return the specified reason for the block. More... | |
canReceiveEmail () | |
Is this user allowed to receive e-mails within limits of current site configuration? More... | |
canSendEmail () | |
Is this user allowed to send e-mails within limits of current site configuration? More... | |
changeableGroups () | |
Returns an array of groups that this user can add and remove. More... | |
changeAuthenticationData (array $data) | |
Changes credentials of the user. More... | |
checkAndSetTouched () | |
Bump user_touched if it didn't change since this object was loaded. More... | |
checkPasswordValidity ( $password) | |
Check if this is a valid password for this user. More... | |
clearAllNotifications () | |
Resets all of the given user's page-change notification timestamps. More... | |
clearInstanceCache ( $reloadFrom=false) | |
Clear various cached data stored in this object. More... | |
clearNotification (&$title, $oldid=0) | |
Clear the user's notification timestamp for the given title. More... | |
clearSharedCache ( $mode='refresh') | |
Clear user data from memcached. More... | |
confirmEmail () | |
Mark the e-mail address confirmed. More... | |
definitelyCan (string $action, PageIdentity $target, PermissionStatus $status=null) | |
@unstable this is a part of the Authority experiment and should not be used yet. More... | |
doLogout () | |
Clear the user's session, and reset the instance cache. More... | |
equals (UserIdentity $user) | |
Checks if two user objects point to the same user. More... | |
getActorId ( $dbwOrWikiId=self::LOCAL) | |
Get the user's actor ID. More... | |
getAutomaticGroups ( $recache=false) | |
Get the list of implicit group memberships this user has. More... | |
getBlock ( $fromReplica=true, $disableIpBlockExemptChecking=false) | |
Get the block affecting the user, or null if the user is not blocked. More... | |
getBlockId () | |
If user is blocked, return the ID for the block. More... | |
getBoolOption ( $oname) | |
Get the user's current setting for a given option, as a boolean value. More... | |
getDatePreference () | |
Get the user's preferred date format. More... | |
getDBTouched () | |
Get the user_touched timestamp field (time of last DB updates) More... | |
getEditCount () | |
Get the user's edit count. More... | |
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. More... | |
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. More... | |
getEffectiveGroups ( $recache=false) | |
Get the list of implicit group memberships this user has. More... | |
getEmail () | |
Get the user's e-mail address. More... | |
getEmailAuthenticationTimestamp () | |
Get the timestamp of the user's e-mail authentication. More... | |
getExperienceLevel () | |
Compute experienced level based on edit count and registration date. More... | |
getFirstEditTimestamp () | |
Get the timestamp of the first edit. More... | |
getFormerGroups () | |
Returns the groups the user has belonged to. More... | |
getGlobalBlock ( $ip='') | |
Check if user is blocked on all wikis. More... | |
getGroupMemberships () | |
Get the list of explicit group memberships this user has, stored as UserGroupMembership objects. More... | |
getGroups () | |
Get the list of explicit group memberships this user has. More... | |
getId () | |
Get the user's ID. More... | |
getInstanceForUpdate () | |
Get a new instance of this user that was loaded from the master via a locking read. More... | |
getIntOption ( $oname, $defaultOverride=0) | |
Get the user's current setting for a given option, as an integer value. More... | |
getLatestEditTimestamp () | |
Get the timestamp of the latest edit. More... | |
getMutableCacheKeys (WANObjectCache $cache) | |
getName () | |
Get the user name, or the IP of an anonymous user. More... | |
getNewMessageLinks () | |
Return the data needed to construct links for new talk page message alerts. More... | |
getNewMessageRevisionId () | |
Get the revision ID for the last talk page revision viewed by the talk page owner. More... | |
getNewtalk () | |
Check if the user has new messages. More... | |
getOption ( $oname, $defaultOverride=null, $ignoreHidden=false) | |
Get the user's current setting for a given option. More... | |
getOptionKinds (IContextSource $context, $options=null) | |
Return an associative array mapping preferences keys to the kind of a preference they're used for. More... | |
getOptions ( $flags=0) | |
Get all user's options. More... | |
getPerformer () | |
@unstable this is a part of the Authority experiment and should not be used yet. More... | |
getRealName () | |
Get the user's real name. More... | |
getRegistration () | |
Get the timestamp of account creation. More... | |
getRequest () | |
Get the WebRequest object to use with this object. More... | |
getRights () | |
Get the permissions this user has. More... | |
getStubThreshold () | |
Get the user preferred stub threshold. More... | |
getTalkPage () | |
Get this user's talk page title. More... | |
getTitleKey () | |
Get the user's name escaped by underscores. More... | |
getToken ( $forceCreation=true) | |
Get the user's current token. More... | |
getTokenFromOption ( $oname) | |
Get a token stored in the preferences (like the watchlist one), resetting it if it's empty (and saving changes). More... | |
getTouched () | |
Get the user touched timestamp. More... | |
getUserId ( $wikiId=self::LOCAL) | |
getUserPage () | |
Get this user's personal page title. More... | |
getWikiId () | |
Returns self::LOCAL to indicate the user is associated with the local wiki. More... | |
idForName ( $flags=self::READ_NORMAL) | |
If only this user's username is known, and it exists, return the user ID. More... | |
incEditCount () | |
Schedule a deferred update to update the user's edit count. More... | |
initEditCountInternal (IDatabase $dbr) | |
Initialize user_editcount from data out of the revision table. More... | |
invalidateCache () | |
Immediately touch the user data cache for this account. More... | |
invalidateEmail () | |
Invalidate the user's e-mail confirmation, and unauthenticate the e-mail address if it was already confirmed. More... | |
isAllowed (string $permission) | |
Checks whether this authority has the given permission in general. More... | |
isAllowedAll (... $permissions) | |
Checks whether this authority has any of the given permissions in general. More... | |
isAllowedAny (... $permissions) | |
Checks whether this authority has any of the given permissions in general. More... | |
isAllowedToCreateAccount () | |
Get whether the user is allowed to create an account. More... | |
isAllowUsertalk () | |
Checks if usertalk is allowed. More... | |
isAnon () | |
Get whether the user is anonymous. More... | |
isBlocked ( $fromReplica=true) | |
Check if user is blocked. More... | |
isBlockedFrom ( $title, $fromReplica=false) | |
Check if user is blocked from editing a particular article. More... | |
isBlockedFromCreateAccount () | |
Get whether the user is explicitly blocked from account creation. More... | |
isBlockedFromEmailuser () | |
Get whether the user is blocked from using Special:Emailuser. More... | |
isBlockedFromUpload () | |
Get whether the user is blocked from using Special:Upload. More... | |
isBlockedGlobally ( $ip='') | |
Check if user is blocked on all wikis. More... | |
isBot () | |
isEmailConfirmationPending () | |
Check whether there is an outstanding request for e-mail confirmation. More... | |
isEmailConfirmed () | |
Is this user's e-mail address valid-looking and confirmed within limits of the current site configuration? More... | |
isHidden () | |
Check if user account is hidden. More... | |
isIPRange () | |
Is the user an IP range? More... | |
isItemLoaded ( $item, $all='all') | |
Return whether an item has been loaded. More... | |
isLocked () | |
Check if user account is locked. More... | |
isLoggedIn () | |
Get whether the user is registered. More... | |
isNewbie () | |
Determine whether the user is a newbie. More... | |
isPingLimitable () | |
Is this user subject to rate limiting? More... | |
isRegistered () | |
Get whether the user is registered. More... | |
isSafeToLoad () | |
Test if it's safe to load this User object. More... | |
isSystemUser () | |
Get whether the user is a system user. More... | |
isTempWatched ( $title, $checkRights=self::CHECK_USER_RIGHTS) | |
Check if the article is temporarily watched. More... | |
isValidPassword ( $password) | |
Is the input a valid password for this user? More... | |
isWatched ( $title, $checkRights=self::CHECK_USER_RIGHTS) | |
Check the watched status of an article. More... | |
load ( $flags=self::READ_NORMAL) | |
Load the user table data for this object from the source given by mFrom. More... | |
loadDefaults ( $name=false, $actorId=null) | |
Set cached properties to default. More... | |
loadFromDatabase ( $flags=self::READ_LATEST) | |
Load user data from the database. More... | |
loadFromId ( $flags=self::READ_NORMAL) | |
Load user table data, given mId has already been set. More... | |
logout () | |
Log this user out. More... | |
matchEditToken ( $val, $salt='', $request=null, $maxage=null) | |
Check given value against the token value stored in the session. More... | |
matchEditTokenNoSuffix ( $val, $salt='', $request=null, $maxage=null) | |
Check given value against the token value stored in the session, ignoring the suffix. More... | |
pingLimiter ( $action='edit', $incrBy=1) | |
Primitive rate limits: enforce maximum actions per time period to put a brake on flooding. More... | |
probablyCan (string $action, PageIdentity $target, PermissionStatus $status=null) | |
@unstable this is a part of the Authority experiment and should not be used yet. More... | |
removeGroup ( $group) | |
Remove the user from the given group. More... | |
removeWatch ( $title, $checkRights=self::CHECK_USER_RIGHTS) | |
Stop watching an article. More... | |
requiresHTTPS () | |
Determine based on the wiki configuration and the user's options, whether this user must be over HTTPS no matter what. More... | |
resetOptions ( $resetKinds=[ 'registered', 'registered-multiselect', 'registered-checkmatrix', 'unused'], IContextSource $context=null) | |
Reset certain (or all) options to the site defaults. More... | |
resetTokenFromOption ( $oname) | |
Reset a token stored in the preferences (like the watchlist one). More... | |
saveSettings () | |
Save this user's settings into the database. More... | |
sendConfirmationMail ( $type='created') | |
Generate a new e-mail confirmation token and send a confirmation/invalidation mail to the user's given address. More... | |
sendMail ( $subject, $body, $from=null, $replyto=null) | |
Send an e-mail to this user's account. More... | |
setActorId (int $actorId) | |
Sets the actor id. More... | |
setCookies ( $request=null, $secure=null, $rememberMe=false) | |
Persist this user's session (e.g. More... | |
setEditCountInternal ( $count) | |
This method should not be called outside User/UserEditCountUpdate. More... | |
setEmail ( $str) | |
Set the user's e-mail address. More... | |
setEmailAuthenticationTimestamp ( $timestamp) | |
Set the e-mail authentication timestamp. More... | |
setEmailWithConfirmation ( $str) | |
Set the user's e-mail address and a confirmation mail if needed. More... | |
setId ( $v) | |
Set the user and reload all fields according to a given ID. More... | |
setItemLoaded ( $item) | |
Set that an item has been loaded. More... | |
setName ( $str) | |
Set the user name. More... | |
setNewtalk ( $val, $curRev=null) | |
Update the 'You have new messages!' status. More... | |
setOption ( $oname, $val) | |
Set the given option for a user. More... | |
setRealName ( $str) | |
Set the user's real name. More... | |
setToken ( $token=false) | |
Set the random token (used for persistent authentication) Called from loadDefaults() among other places. More... | |
spreadAnyEditBlock () | |
If this user is logged-in and blocked, block any IP address they've successfully logged in from. More... | |
touch () | |
Update the "touched" timestamp for the user. More... | |
useFilePatrol () | |
Check whether to enable new files patrol features for this user. More... | |
useNPPatrol () | |
Check whether to enable new pages patrol features for this user. More... | |
useRCPatrol () | |
Check whether to enable recent changes patrol features for this user. More... | |
validateCache ( $timestamp) | |
Validate the cache for this account. More... | |
![]() | |
assertWiki ( $wikiId) | |
Throws if $wikiId is different from the return value of getWikiId(). More... | |
Static Public Member Functions | |
static | changeableByGroup ( $group) |
Returns an array of the groups that a particular group can add/remove. More... | |
static | createNew ( $name, $params=[]) |
Add a user to the database, return the user object. More... | |
static | findUsersByGroup ( $groups, $limit=5000, $after=null) |
Return the users who are members of the given group(s). More... | |
static | getAllGroups () |
Return the set of defined explicit groups. More... | |
static | getCanonicalName ( $name, $validate='valid') |
Given unvalidated user input, return a canonical username, or false if the username is invalid. More... | |
static | getDefaultOption ( $opt) |
Get a given default option value. More... | |
static | getDefaultOptions () |
Combine the language default options with any site-specific options and add the default language variants. More... | |
static | getGrantName ( $grant) |
Get the name of a given grant. More... | |
static | getGroupPermissions ( $groups) |
Get the permissions associated with a given list of groups. More... | |
static | getGroupsWithPermission ( $role) |
Get all the groups who have a given permission. More... | |
static | getImplicitGroups () |
static | getQueryInfo () |
Return the tables, fields, and join conditions to be selected to create a new user object. More... | |
static | getRightDescription ( $right) |
Get the description of a given right. More... | |
static | groupHasPermission ( $group, $role) |
Check, if the given group has the given permission. More... | |
static | idFromName ( $name, $flags=self::READ_NORMAL) |
Get database id given a user name. More... | |
static | isCreatableName ( $name) |
Usernames which fail to pass this function will be blocked from new account registrations, but may be used internally either by batch processes or by user accounts which have already been created. More... | |
static | isIP ( $name) |
Does the string match an anonymous IP address? More... | |
static | isUsableName ( $name) |
Usernames which fail to pass this function will be blocked from user login and new account registrations, but may be used internally by batch processes. More... | |
static | isValidUserName ( $name) |
Is the input a valid username? More... | |
static | listOptionKinds () |
Return a list of the types of user options currently returned by User::getOptionKinds(). More... | |
static | newFatalPermissionDeniedStatus ( $permission) |
Factory function for fatal permission-denied errors. More... | |
static | purge ( $dbDomain, $userId) |
static | resetIdByNameCache () |
Reset the cache used in idFromName(). More... | |
static | whoIs ( $id) |
Get the username corresponding to a given user ID. More... | |
static | whoIsReal ( $id) |
Get the real name of a user given their user ID. More... | |
newFrom*() static factory methods | |
static | newFromName ( $name, $validate='valid') |
static | newFromId ( $id) |
Static factory method for creation from a given user ID. More... | |
static | newFromActorId ( $id) |
Static factory method for creation from a given actor ID. More... | |
static | newFromIdentity (UserIdentity $identity) |
Returns a User object corresponding to the given UserIdentity. More... | |
static | newFromAnyId ( $userId, $userName, $actorId, $dbDomain=false) |
Static factory method for creation from an ID, name, and/or actor ID. More... | |
static | newFromConfirmationCode ( $code, $flags=self::READ_NORMAL) |
Factory method to fetch whichever user has a given email confirmation code. More... | |
static | newFromSession (WebRequest $request=null) |
Create a new user object using data from session. More... | |
static | newFromRow ( $row, $data=null) |
Create a new user object from a user row. More... | |
static | newSystemUser ( $name, $options=[]) |
Static factory method for creation of a "system" user from username. More... | |
Public Attributes | |
int null | $mActorId |
Switched from protected to public for use in UserFactory. More... | |
AbstractBlock null | $mBlock |
string int | $mBlockedby |
string | $mEmail |
string | $mEmailAuthenticated |
string | $mFrom |
Initialization data source if mLoadedItems!==true. More... | |
bool | $mHideName |
int | $mId |
Cache variables. More... | |
string | $mName |
string | $mRealName |
string | $mTouched |
TS_MW timestamp from the DB. More... | |
const | CHECK_USER_RIGHTS = true |
const | GETOPTIONS_EXCLUDE_DEFAULTS = UserOptionsLookup::EXCLUDE_DEFAULTS |
Exclude user options that are set to their default value. More... | |
const | IGNORE_USER_RIGHTS = false |
const | INVALID_TOKEN = '*** INVALID ***' |
An invalid string value for the user_token field. More... | |
const | TOKEN_LENGTH = 32 |
Number of characters required for the user_token field. More... | |
![]() | |
const | READ_NONE = -1 |
Constants for object loading bitfield flags (higher => higher QoS) More... | |
Static Public Attributes | |
static int[] | $idCacheByName = [] |
Protected Member Functions | |
confirmationToken (&$expiration) | |
Generate, store, and return a new e-mail confirmation code. More... | |
confirmationTokenUrl ( $token) | |
Return a URL the user can use to confirm their email address. More... | |
getCacheKey (WANObjectCache $cache) | |
getTokenUrl ( $page, $token) | |
Internal function to format the e-mail validation/invalidation URLs. More... | |
invalidationTokenUrl ( $token) | |
Return a URL the user can use to invalidate their email address. More... | |
loadFromCache () | |
Load user data from shared cache, given mId has already been set. More... | |
loadFromRow ( $row, $data=null) | |
Initialize this object from a row from the user table. More... | |
loadFromUserObject ( $user) | |
Load the data for this user object from another user object. More... | |
makeUpdateConditions (IDatabase $db, array $conditions) | |
Builds update conditions. More... | |
spreadBlock () | |
If this (non-anonymous) user is blocked, block the IP address they've successfully logged in from. More... | |
Protected Attributes | |
bool | $mAllowUsertalk |
string | $mBlockreason |
TODO: This should be removed when User::BlockedFor and AbstractBlock::getReason are hard deprecated. More... | |
string | $mDatePreference |
Lazy-initialized variables, invalidated with clearInstanceCache. More... | |
int | $mEditCount |
string | $mEmailToken |
string | $mEmailTokenExpires |
AbstractBlock | $mGlobalBlock |
string | $mHash |
array bool | $mLoadedItems = [] |
Array with already loaded items or true if all items have been loaded. More... | |
bool | $mLocked |
string | $mQuickTouched |
TS_MW timestamp from cache. More... | |
string | $mRegistration |
string | $mToken |
int | $queryFlagsUsed = self::READ_NORMAL |
User::READ_* constant bitfield used to load data. More... | |
Static Protected Attributes | |
static string[] | $mCacheVars |
List of member variables which are saved to the shared cache (memcached). More... | |
Private Member Functions | |
getBlockedStatus ( $fromReplica=true, $disableIpBlockExemptChecking=false) | |
Get blocking information. More... | |
getThisAsAuthority () | |
Returns the Authority of this User if it's the main request context user. More... | |
isGlobalSessionUser () | |
Check whether this is the global session user. More... | |
loadFromSession () | |
Load user data from the session. More... | |
newTouchedTimestamp () | |
Generate a current or new-future timestamp to be stored in the user_touched field when we update things. More... | |
updateActorId (IDatabase $dbw) | |
Update the actor ID after an insert. More... | |
Private Attributes | |
AbstractBlock bool | $mBlockedFromCreateAccount = false |
WebRequest | $mRequest |
Authority null | $mThisAsAuthority |
lazy-initialized Authority of this user More... | |
const | VERSION = 16 |
Version number to tag cached versions of serialized User objects. More... | |
The User object 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.
@newable in 1.35 only, the constructor is
User::__construct | ( | ) |
Lightweight constructor for an anonymous user.
Stable to call since 1.35
Definition at line 255 of file User.php.
References clearInstanceCache().
& User::__get | ( | $name | ) |
Definition at line 276 of file User.php.
References getOptions(), getRights(), wfDeprecated(), and wfLogWarning().
User::__set | ( | $name, | |
$value | |||
) |
Definition at line 297 of file User.php.
References setOption(), wfDeprecated(), and wfLogWarning().
User::addAutopromoteOnceGroups | ( | $event | ) |
Add the user to the group if he/she meets given criteria.
Contrary to autopromotion by \ref $wgAutopromote, the group will be possible to remove manually via Special:UserRights. In such case it will not be re-added automatically. The user will also not lose the group if they no longer meet the criteria.
string | $event | Key in $wgAutopromoteOnce (each one has groups/criteria) |
Definition at line 1472 of file User.php.
Referenced by MediaWiki\Storage\PageUpdater\saveRevision().
User::addGroup | ( | $group, | |
$expiry = null |
|||
) |
Add the user to the given group.
This takes immediate effect. If the user is already in the group, the expiry time will be updated to the new expiry time. (If $expiry is omitted or null, the membership will be altered to never expire.)
string | $group | Name of the group to add |
string | null | $expiry | Optional expiry timestamp in any format acceptable to wfTimestamp(), or null if the group assignment should not expire |
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.
MWException |
Definition at line 3599 of file User.php.
References $mId, $mName, Wikimedia\Rdbms\IDatabase\affectedRows(), clearInstanceCache(), DB_MASTER, Wikimedia\Rdbms\IDatabase\insert(), Wikimedia\Rdbms\IDatabase\insertId(), load(), loadFromDatabase(), StatusValue\newFatal(), StatusValue\newGood(), PasswordFactory\newInvalidPassword(), newTouchedTimestamp(), Wikimedia\Rdbms\IDatabase\selectField(), setToken(), Wikimedia\Rdbms\IDatabase\timestamp(), Wikimedia\Rdbms\IDatabase\timestampOrNull(), updateActorId(), and wfGetDB().
Referenced by MediaWiki\Auth\AuthManager\autoCreateUser().
User::addWatch | ( | $title, | |
$checkRights = self::CHECK_USER_RIGHTS , |
|||
?string | $expiry = null |
||
) |
Watch an article.
Title | $title | Title of the article to look at |
bool | $checkRights | Whether to check 'viewmywatchlist'/'editmywatchlist' rights. Pass User::CHECK_USER_RIGHTS or User::IGNORE_USER_RIGHTS. |
string | null | $expiry | Optional expiry timestamp in any format acceptable to wfTimestamp(), null will not create expiries, or leave them unchanged should they already exist. |
Definition at line 3210 of file User.php.
References $title, invalidateCache(), and isAllowed().
Referenced by MediaWiki\Auth\AuthManager\autoCreateUser().
User::authorizeRead | ( | string | $action, |
PageIdentity | $target, | ||
PermissionStatus | $status = null |
||
) |
@unstable this is a part of the Authority experiment and should not be used yet.
string | $action | |
PageIdentity | $target | |
PermissionStatus | null | $status |
Implements MediaWiki\Permissions\Authority.
Definition at line 4541 of file User.php.
References getThisAsAuthority().
User::authorizeWrite | ( | string | $action, |
PageIdentity | $target, | ||
PermissionStatus | $status = null |
||
) |
@unstable this is a part of the Authority experiment and should not be used yet.
string | $action | |
PageIdentity | $target | |
PermissionStatus | null | $status |
Implements MediaWiki\Permissions\Authority.
Definition at line 4553 of file User.php.
References getThisAsAuthority().
Referenced by MediaWiki\Auth\AuthManager\checkAccountCreatePermissions().
User::blockedBy | ( | ) |
If user is blocked, return the name of the user who placed the block.
Definition at line 1955 of file User.php.
References $mBlockedby, and getBlockedStatus().
User::blockedFor | ( | ) |
If user is blocked, return the specified reason for the block.
Definition at line 1966 of file User.php.
References $mBlockreason, and getBlockedStatus().
User::canReceiveEmail | ( | ) |
Is this user allowed to receive e-mails within limits of current site configuration?
Definition at line 4065 of file User.php.
References getOption(), and isEmailConfirmed().
User::canSendEmail | ( | ) |
Is this user allowed to send e-mails within limits of current site configuration?
Definition at line 4050 of file User.php.
References $wgEnableEmail, $wgEnableUserEmail, isAllowed(), and isEmailConfirmed().
Referenced by ApiQueryInfo\getEmailToken().
|
static |
Returns an array of the groups that a particular group can add/remove.
string | $group | The group to check for whether it can add/remove |
Definition at line 4232 of file User.php.
References $wgAddGroups, $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf, $wgRemoveGroups, and getAllGroups().
Referenced by changeableGroups().
User::changeableGroups | ( | ) |
Returns an array of groups that this user can add and remove.
Definition at line 4305 of file User.php.
References changeableByGroup(), getEffectiveGroups(), and isAllowed().
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. |
Definition at line 2446 of file User.php.
References StatusValue\newGood().
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 1506 of file User.php.
References $success, clearSharedCache(), DB_MASTER, load(), newTouchedTimestamp(), and wfGetDB().
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 1129 of file User.php.
References $wgPasswordPolicy, and StatusValue\newGood().
Referenced by isValidPassword().
User::clearAllNotifications | ( | ) |
Resets all of the given user's page-change notification timestamps.
If e-notif e-mails are on, they will receive notification mails on the next change of any watched page.
Definition at line 3277 of file User.php.
References wfDeprecated().
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 1544 of file User.php.
References $wgFullyInitialised.
Referenced by __construct(), addToDatabase(), doLogout(), UserrightsPage\execute(), and setId().
User::clearNotification | ( | & | $title, |
$oldid = 0 |
|||
) |
Clear the user's notification timestamp for the given title.
If e-notif e-mails are on, they will receive notification mails on the next change of the page if it's watched etc.
Title | &$title | Title of the article to look at |
int | $oldid | The revision id being viewed. If not given or 0, latest revision is assumed. |
Definition at line 3262 of file User.php.
References $title.
Referenced by WikiPage\doViewUpdates().
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 2336 of file User.php.
References $cache, DB_MASTER, getCacheKey(), and getId().
Referenced by checkAndSetTouched(), invalidateCache(), and saveSettings().
|
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 3949 of file User.php.
References $wgUserEmailConfirmationTokenExpiry, MWCryptRand\generateHex(), load(), and wfTimestamp().
Referenced by sendConfirmationMail().
|
protected |
Return a URL the user can use to confirm their email address.
string | $token | Accepts the email confirmation token |
Definition at line 3967 of file User.php.
References getTokenUrl().
Referenced by sendConfirmationMail().
User::confirmEmail | ( | ) |
Mark the e-mail address confirmed.
Definition at line 4007 of file User.php.
References isEmailConfirmed(), setEmailAuthenticationTimestamp(), and 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 3521 of file User.php.
References Wikimedia\Rdbms\IDatabase\affectedRows(), DB_MASTER, Wikimedia\Rdbms\IDatabase\insert(), load(), PasswordFactory\newInvalidPassword(), wfDeprecated(), and wfGetDB().
Referenced by newSystemUser().
User::definitelyCan | ( | string | $action, |
PageIdentity | $target, | ||
PermissionStatus | $status = null |
||
) |
@unstable this is a part of the Authority experiment and should not be used yet.
string | $action | |
PageIdentity | $target | |
PermissionStatus | null | $status |
Implements MediaWiki\Permissions\Authority.
Definition at line 4530 of file User.php.
References getThisAsAuthority().
User::doLogout | ( | ) |
Clear the user's session, and reset the instance cache.
Definition at line 3380 of file User.php.
References clearInstanceCache(), MediaWiki\Logger\LoggerFactory\getInstance(), and getRequest().
Referenced by logout().
User::equals | ( | UserIdentity | $user | ) |
Checks if two user objects point to the same user.
UserIdentity | $user |
Implements MediaWiki\User\UserIdentity.
Definition at line 4490 of file User.php.
References getName(), and MediaWiki\User\UserIdentity\getName().
|
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 1052 of file User.php.
References $dbr, DB_REPLICA, UserArray\newFromIDs(), and wfGetDB().
Referenced by EmptyUserGroup\execute().
User::getActorId | ( | $dbwOrWikiId = self::LOCAL | ) |
Get the user's actor ID.
IDatabase | string | false | $dbwOrWikiId | wiki ID, if provided, must be self::LOCAL Will assign a new actor ID if none exists and if IDatabase is passed. Passing IDatabase is deprecated since 1.36. Use ActorNormalization()::acquireActorId() instead. |
PreconditionException | if $dbwOrWikiId is a string and does not match the local wiki |
Implements MediaWiki\User\UserIdentity.
Definition at line 2150 of file User.php.
References $mActorId, MediaWiki\DAO\WikiAwareEntity\assertWiki(), isItemLoaded(), load(), and wfDeprecatedMsg().
Referenced by RecentChange\newForCategorization().
|
static |
Return the set of defined explicit groups.
The implicit groups (by default *, 'user' and 'autoconfirmed') are not included, as they are defined automatically, not in the database.
Definition at line 4206 of file User.php.
Referenced by ApiQuerySiteinfo\appendUserGroups(), changeableByGroup(), CreateAndPromote\execute(), ApiUserrights\getAllGroups(), ApiQueryAllUsers\getAllowedParams(), and ApiQueryContributors\getAllowedParams().
User::getAutomaticGroups | ( | $recache = false | ) |
Get the list of implicit group memberships this user has.
This includes 'user' if logged in, '*' for all accounts, and autopromoted groups
bool | $recache | Whether to avoid the cache |
User::getBlock | ( | $fromReplica = true , |
|
$disableIpBlockExemptChecking = false |
|||
) |
Get the block affecting the user, or null if the user is not blocked.
bool | $fromReplica | Whether to check the replica DB instead of the master |
bool | $disableIpBlockExemptChecking | This is used internally to prevent a infinite recursion with autopromote. See T270145. |
Definition at line 1930 of file User.php.
References getBlockedStatus().
Referenced by Action\checkCanExecute(), MediaWiki\User\UserGroupManager\checkCondition(), FormSpecialPage\checkExecutePermissions(), MediaWiki\Permissions\PermissionManager\checkUserBlock(), isBlocked(), PasswordReset\isBlocked(), MediaWiki\Permissions\PermissionManager\isBlockedFrom(), spreadAnyEditBlock(), and MediaWiki\Block\BlockManager\trackBlockWithCookie().
|
private |
Get blocking information.
TODO: Move this into the BlockManager, along with block-related properties.
bool | $fromReplica | Whether to check the replica DB first. To improve performance, non-critical checks are done against replica DBs. Check when actually saving should be done against master. |
bool | $disableIpBlockExemptChecking | This is used internally to prevent a infinite recursion with autopromote. See T270145. |
Definition at line 1605 of file User.php.
References getName(), getRequest(), isGlobalSessionUser(), load(), and wfDebug().
Referenced by blockedBy(), blockedFor(), getBlock(), getBlockId(), isBlockedFromCreateAccount(), isBlockedFromEmailuser(), isBlockedFromUpload(), and isHidden().
User::getBlockId | ( | ) |
If user is blocked, return the ID for the block.
Definition at line 1975 of file User.php.
References getBlockedStatus().
User::getBoolOption | ( | $oname | ) |
Get the user's current setting for a given option, as a boolean value.
string | $oname | The option to check |
Definition at line 2684 of file User.php.
Referenced by Parser\getUserSig(), getWatchlistValue(), CssContent\preSaveTransform(), JavaScriptContent\preSaveTransform(), MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences(), and requiresHTTPS().
|
protected |
WANObjectCache | $cache |
Definition at line 487 of file User.php.
References $cache.
Referenced by clearSharedCache(), getMutableCacheKeys(), and loadFromCache().
|
static |
Given unvalidated user input, return a canonical username, or false if the username is invalid.
string | $name | User input |
string | bool | $validate | Type of validation to use:
|
InvalidArgumentException |
Definition at line 1173 of file User.php.
Referenced by ExternalUserNames\applyPrefix(), MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider\beginPrimaryAuthentication(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\beginPrimaryAuthentication(), ApiQueryUserContribs\execute(), ApiQueryUsers\execute(), RollbackEdits\execute(), DeleteLocalPasswords\initialize(), HTMLUsersMultiselectField\loadDataFromRequest(), ApiQueryBlocks\prepareUsername(), MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider\providerAllowsAuthenticationDataChange(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\providerAllowsAuthenticationDataChange(), MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider\providerChangeAuthenticationData(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\providerChangeAuthenticationData(), MediaWiki\Auth\AbstractPrimaryAuthenticationProvider\providerNormalizeUsername(), WebInstallerName\submit(), MediaWiki\Session\CookieSessionProvider\suggestLoginUsername(), MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider\testUserCanAuthenticate(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\testUserCanAuthenticate(), MediaWiki\Auth\LocalPasswordPrimaryAuthenticationProvider\testUserExists(), and MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\testUserExists().
User::getDatePreference | ( | ) |
Get the user's preferred date format.
Definition at line 2853 of file User.php.
References $mDatePreference, $wgLang, and getOption().
Referenced by Language\getHumanTimestampInternal(), and Language\internalUserTimeAndDate().
User::getDBTouched | ( | ) |
|
static |
Get a given default option value.
string | $opt | Name of option to retrieve |
Definition at line 1588 of file User.php.
Referenced by ConvertUserOptions\convertOptionBatch(), Language\dateFormat(), CoreParserFunctions\gender(), ParserOptions\getDefaults(), and Linker\makeImageLink().
|
static |
Combine the language default options with any site-specific options and add the default language variants.
Definition at line 1575 of file User.php.
Referenced by ApiQuerySiteinfo\appendDefaultOptions(), UserOptionsMaintenance\listAvailableOptions(), MediaWiki\Preferences\DefaultPreferencesFactory\loadPreferenceValues(), and UserOptionsMaintenance\showUsageStats().
User::getEditCount | ( | ) |
Get the user's edit count.
Definition at line 3000 of file User.php.
References $mEditCount, and getId().
Referenced by MediaWiki\Storage\PageEditStash\checkCache(), getExperienceLevel(), loadFromDatabase(), MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences(), and MediaWiki\Storage\PageEditStash\storeStashValue().
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 |
Definition at line 3826 of file User.php.
References getEditTokenObject().
Referenced by ApiQueryInfo\getEmailToken(), ApiQueryInfo\getImportToken(), ApiQueryInfo\getOptionsToken(), ApiQueryRecentChanges\getPatrolToken(), ApiQueryRevisions\getRollbackToken(), ApiQueryUsers\getUserrightsToken(), ApiQueryInfo\getUserToken(), WatchAction\getWatchToken(), and ApiQueryInfo\getWatchToken().
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 3802 of file User.php.
References getRequest(), and isAnon().
Referenced by getEditToken(), ApiQueryTokens\getToken(), and matchEditToken().
User::getEffectiveGroups | ( | $recache = false | ) |
Get the list of implicit group memberships this user has.
This includes all explicit groups, plus 'user' if logged in, '*' for all accounts, and autopromoted groups
bool | $recache | Whether to avoid the cache |
Definition at line 2957 of file User.php.
Referenced by changeableGroups(), UserPasswordPolicy\getPoliciesForUser(), and MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
User::getEmail | ( | ) |
Get the user's e-mail address.
Definition at line 2532 of file User.php.
References $mEmail, and load().
Referenced by SpecialChangeEmail\attemptChange(), MediaWiki\User\UserGroupManager\checkCondition(), isEmailConfirmed(), isSystemUser(), MailAddress\newFromUser(), MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences(), setEmail(), and setEmailWithConfirmation().
User::getEmailAuthenticationTimestamp | ( | ) |
Get the timestamp of the user's e-mail authentication.
Definition at line 2542 of file User.php.
References $mEmailAuthenticated, and load().
Referenced by MediaWiki\User\UserGroupManager\checkCondition(), isEmailConfirmed(), and MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
User::getExperienceLevel | ( | ) |
Compute experienced level based on edit count and registration date.
Definition at line 3289 of file User.php.
References $wgExperiencedUserEdits, $wgExperiencedUserMemberSince, $wgLearnerEdits, $wgLearnerMemberSince, getEditCount(), getRegistration(), isAnon(), and wfTimestamp().
User::getFirstEditTimestamp | ( | ) |
User::getFormerGroups | ( | ) |
Returns the groups the user has belonged to.
The user may still belong to the returned groups. Compare with getGroups().
The function will not return groups the user had belonged to before MW 1.17
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 |
FatalError | |
MWException |
Definition at line 2002 of file User.php.
References getName(), and getRequest().
Referenced by PasswordReset\isBlocked(), and isBlockedGlobally().
|
static |
Get the name of a given grant.
string | $grant | Grant to query |
Definition at line 4398 of file User.php.
References MWGrants\grantName(), and wfDeprecated().
User::getGroupMemberships | ( | ) |
Get the list of explicit group memberships this user has, stored as UserGroupMembership objects.
Implicit groups are not included.
Definition at line 2941 of file User.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
|
static |
Get the permissions associated with a given list of groups.
string[] | $groups | internal group names |
User::getGroups | ( | ) |
Get the list of explicit group memberships this user has.
The implicit * and user groups are not included.
Definition at line 2926 of file User.php.
Referenced by isBot(), and pingLimiter().
|
static |
Get all the groups who have a given permission.
string | $role | Role to check |
Definition at line 4175 of file User.php.
Referenced by newFatalPermissionDeniedStatus().
User::getId | ( | ) |
Get the user's ID.
Implements MediaWiki\User\UserIdentity.
Definition at line 2061 of file User.php.
References $mId, ExternalUserNames\isExternal(), isItemLoaded(), and load().
Referenced by UserEditCountUpdate\__construct(), UploadFromChunks\__construct(), MediaWiki\Auth\AuthManager\autoCreateUser(), MediaWiki\Auth\AuthManager\beginAccountCreation(), MediaWiki\Auth\AuthManager\beginAccountLink(), EmailNotification\canSendUserTalkEmail(), clearSharedCache(), WikiPage\doDeleteArticleBatched(), WikiPage\doUpdateRestrictions(), ApiUnblock\execute(), PasswordReset\execute(), getEditCount(), getInstanceForUpdate(), getMutableCacheKeys(), MediaWiki\Storage\PageEditStash\getStashKey(), getTokenFromOption(), UploadBase\getUploadSessionKey(), getUserId(), RequestContext\importScopedSession(), LocalIdLookup\isAttached(), isRegistered(), loadFromSession(), SpecialMute\loadTarget(), RecentChange\newForCategorization(), EmailNotification\notifyOnPageChange(), pingLimiter(), touch(), MediaWiki\Block\UnblockUser\unblockUnsafe(), and SpecialEmailUser\validateTarget().
|
static |
User::getInstanceForUpdate | ( | ) |
Get a new instance of this user that was loaded from the master 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 master but without proper locks.
Definition at line 4470 of file User.php.
References getId(), and newFromId().
Referenced by SpecialChangeEmail\attemptChange().
User::getIntOption | ( | $oname, | |
$defaultOverride = 0 |
|||
) |
Get the user's current setting for a given option, as an integer value.
string | $oname | The option to check |
int | $defaultOverride | A default value returned if the option does not exist |
Definition at line 2699 of file User.php.
Referenced by WebRequest\getLimitOffsetForUser(), and getStubThreshold().
User::getLatestEditTimestamp | ( | ) |
User::getMutableCacheKeys | ( | WANObjectCache | $cache | ) |
WANObjectCache | $cache |
Definition at line 498 of file User.php.
References getCacheKey(), and getId().
User::getName | ( | ) |
Get the user name, or the IP of an anonymous user.
Implements MediaWiki\User\UserIdentity.
Definition at line 2107 of file User.php.
References $mName, getRequest(), isItemLoaded(), and load().
Referenced by MediaWiki\Session\UserInfo\__construct(), __toString(), EmailNotification\actuallyNotifyOnPageChange(), MediaWiki\Auth\AuthManager\autoCreateUser(), MediaWiki\Auth\AuthManager\beginAccountCreation(), MediaWiki\Auth\AuthManager\beginAccountLink(), CentralIdLookup\centralIdFromLocalUser(), MediaWiki\Storage\PageEditStash\checkCache(), PasswordPolicyChecks\checkPasswordCannotBeSubstringInUsername(), PasswordPolicyChecks\checkPasswordCannotMatchDefaults(), PasswordPolicyChecks\checkPasswordCannotMatchUsername(), WikiPage\doEditUpdates(), RecentChange\doMarkPatrolled(), equals(), ApiUnblock\execute(), PasswordReset\execute(), MediaWiki\Preferences\DefaultPreferencesFactory\generateSkinOptions(), MediaWiki\Storage\PageUpdater\getAtomicSectionUpdate(), getBlockedStatus(), ApiQueryUserInfo\getCentralUserInfo(), getGlobalBlock(), MediaWiki\Storage\PageEditStash\getStashKey(), getTitleKey(), UploadBase\getUploadSessionKey(), ArchivedFile\getUser(), LocalFile\getUser(), getUserPage(), Parser\getUserSig(), idForName(), PasswordReset\isAllowed(), isGlobalSessionUser(), CreditsAction\link(), loadFromSession(), RecentChange\newForCategorization(), MailAddress\newFromUser(), EmailNotification\notifyOnPageChange(), pingLimiter(), SpecialBlock\preText(), SpecialBlock\processFormInternal(), MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences(), MediaWiki\Storage\PageEditStash\pruneExcessStashedEntries(), MediaWiki\Storage\PageEditStash\recentStashEntryCount(), LocalFile\recordUpload3(), sendConfirmationMail(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\sendNewAccountEmail(), setEmailWithConfirmation(), MediaWiki\Preferences\DefaultPreferencesFactory\skinPreferences(), spreadBlock(), MediaWiki\Auth\ResetPasswordSecondaryAuthenticationProvider\tryReset(), and CreditsAction\userLink().
User::getNewMessageLinks | ( | ) |
Return the data needed to construct links for new talk page message alerts.
If there are new messages, this will return an associative array with the following data: wiki: The database name of the wiki link: Root-relative link to the user's talk page rev: The last talk page revision that the user has seen or null. This is useful for building diff links. If there are no new messages, it returns an empty array.
Definition at line 2228 of file User.php.
References WikiMap\getCurrentWikiId(), getTalkPage(), and wfDeprecated().
Referenced by getNewMessageRevisionId().
User::getNewMessageRevisionId | ( | ) |
Get the revision ID for the last talk page revision viewed by the talk page owner.
Definition at line 2267 of file User.php.
References getNewMessageLinks(), WikiMap\isCurrentWikiId(), and wfDeprecated().
User::getNewtalk | ( | ) |
Check if the user has new messages.
Definition at line 2205 of file User.php.
References wfDeprecated().
User::getOption | ( | $oname, | |
$defaultOverride = null , |
|||
$ignoreHidden = false |
|||
) |
Get the user's current setting for a given option.
string | $oname | The option to check |
mixed | null | $defaultOverride | A default value returned if the option does not exist. Default values set via $wgDefaultUserOptions / UserGetDefaultOptions take precedence. |
bool | $ignoreHidden | Whether to ignore the effects of $wgHiddenPrefs |
Reimplemented in PPFuzzUser.
Definition at line 2652 of file User.php.
Referenced by MediaWiki\EditPage\TextboxBuilder\buildTextboxAttribs(), canReceiveEmail(), MediaWiki\Preferences\DefaultPreferencesFactory\datetimePreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\generateSkinOptions(), getDatePreference(), RequestContext\getLanguage(), getTokenFromOption(), Parser\getUserSig(), LanguageConverter\getUserVariant(), Language\internalUserTimeAndDate(), MWTimestamp\offsetForUser(), MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences(), and MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\sendNewAccountEmail().
User::getOptionKinds | ( | IContextSource | $context, |
$options = null |
|||
) |
Return an associative array mapping preferences keys to the kind of a preference they're used for.
Different kinds are handled differently when setting or reading preferences.
See User::listOptionKinds for the list of valid option types that can be provided.
IContextSource | $context | |
array | null | $options | Assoc. array with options keys to check as keys. Defaults to $this->mOptions. |
User::getOptions | ( | $flags = 0 | ) |
Get all user's options.
int | $flags | Bitwise combination of: User::GETOPTIONS_EXCLUDE_DEFAULTS Exclude user options that are set to the default value. (Since 1.25) |
Definition at line 2670 of file User.php.
Referenced by __get(), and MediaWiki\Preferences\DefaultPreferencesFactory\loadPreferenceValues().
User::getPerformer | ( | ) |
@unstable this is a part of the Authority experiment and should not be used yet.
Implements MediaWiki\Permissions\Authority.
|
static |
Return the tables, fields, and join conditions to be selected to create a new user object.
$table
to IDatabase->select()
$vars
to IDatabase->select()
$join_conds
to IDatabase->select()
Definition at line 4412 of file User.php.
Referenced by ApiQueryUsers\execute(), PasswordReset\getUsersByEmail(), loadFromDatabase(), UserArray\newFromIDs(), UserArray\newFromNames(), newSystemUser(), and RebuildRecentchanges\rebuildRecentChangesTablePass4().
User::getRealName | ( | ) |
Get the user's real name.
Definition at line 2623 of file User.php.
References $mRealName, isItemLoaded(), and load().
Referenced by CreditsAction\link(), MailAddress\newFromUser(), MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences(), and CreditsAction\userLink().
User::getRegistration | ( | ) |
Get the timestamp of account creation.
Definition at line 4120 of file User.php.
References $mRegistration, isAnon(), and load().
Referenced by MediaWiki\User\UserGroupManager\checkCondition(), getExperienceLevel(), and MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
User::getRequest | ( | ) |
Get the WebRequest object to use with this object.
Definition at line 3161 of file User.php.
References $mRequest, and RequestContext\getMain().
Referenced by MediaWiki\Storage\PageEditStash\checkCache(), MediaWiki\User\UserGroupManager\checkCondition(), doLogout(), PasswordReset\execute(), getBlockedStatus(), getEditTokenObject(), getGlobalBlock(), getName(), isBlockedFromCreateAccount(), isPingLimitable(), loadFromSession(), pingLimiter(), requiresHTTPS(), sendConfirmationMail(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\sendNewAccountEmail(), setCookies(), setEmailWithConfirmation(), spreadBlock(), and MediaWiki\Block\BlockManager\trackBlockWithCookie().
|
static |
Get the description of a given right.
string | $right | Right to query |
Definition at line 4384 of file User.php.
References wfMessage().
Referenced by SpecialListGrants\execute(), SpecialListGroupRights\formatPermissions(), SpecialListGroupRights\outputNamespaceProtectionInfo(), and CreateBotPassword\showGrants().
User::getRights | ( | ) |
Get the permissions this user has.
Definition at line 2914 of file User.php.
Referenced by __get().
User::getStubThreshold | ( | ) |
Get the user preferred stub threshold.
Definition at line 2895 of file User.php.
References $wgMaxArticleSize, and getIntOption().
Referenced by MediaWiki\Linker\LinkRendererFactory\createForUser().
User::getTalkPage | ( | ) |
Get this user's talk page title.
Definition at line 3777 of file User.php.
References $title, and getUserPage().
Referenced by getNewMessageLinks(), and MediaWiki\Permissions\PermissionManager\isBlockedFrom().
|
private |
Returns the Authority of this User if it's the main request context user.
This is intended to exist only for the period of transition to Authority.
Definition at line 4562 of file User.php.
References $mThisAsAuthority.
Referenced by authorizeRead(), authorizeWrite(), definitelyCan(), isAllowed(), isAllowedAll(), isAllowedAny(), and probablyCan().
User::getTitleKey | ( | ) |
Get the user's name escaped by underscores.
Definition at line 2196 of file User.php.
References getName().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
User::getToken | ( | $forceCreation = true | ) |
Get the user's current token.
bool | $forceCreation | Force the generation of a new token if the user doesn't have one (default=true for backwards compatibility). |
Definition at line 2473 of file User.php.
References $mToken, $wgAuthenticationTokenVersion, MWCryptRand\generateHex(), MWCryptHash\hmac(), load(), and setToken().
Referenced by getTokenFromOption(), and loadFromSession().
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 2733 of file User.php.
References $wgHiddenPrefs, getId(), getOption(), and getToken().
|
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 3994 of file User.php.
References $title, Title\makeTitle(), and NS_MAIN.
Referenced by confirmationTokenUrl(), and invalidationTokenUrl().
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 2406 of file User.php.
References $cache, $mTouched, load(), and wfTimestamp().
Referenced by validateCache().
User::getUserId | ( | $wikiId = self::LOCAL | ) |
string | false | $wikiId | The wiki ID expected by the caller. Use self::LOCAL for the local wiki. |
PreconditionException | if $wikiId mismatches $this->getWikiId() |
Implements MediaWiki\User\UserIdentity.
Definition at line 2089 of file User.php.
References MediaWiki\DAO\WikiAwareEntity\assertWiki(), and getId().
User::getUserPage | ( | ) |
Get this user's personal page title.
Definition at line 3768 of file User.php.
References getName(), Title\makeTitle(), and NS_USER.
Referenced by MediaWiki\Auth\AuthManager\autoCreateUser(), getTalkPage(), SpecialBlock\getTargetUserTitle(), CreditsAction\link(), MediaWiki\Block\UnblockUser\log(), and saveSettings().
User::getWikiId | ( | ) |
Returns self::LOCAL to indicate the user is associated with the local wiki.
Implements MediaWiki\DAO\WikiAwareEntity.
|
static |
Check, if the given group has the given permission.
If you're wanting to check whether all users have a permission, use PermissionManager::isEveryoneAllowed() instead. That properly checks if it's revoked from anyone.
string | $group | Group to check |
string | $role | Role to check |
User::idForName | ( | $flags = self::READ_NORMAL | ) |
|
static |
Get database id given a user name.
string | $name | Username |
int | $flags | User::READ_* constant bitfield |
Definition at line 930 of file User.php.
References $s, DBAccessObjectUtils\getDBOptions(), Title\makeTitleSafe(), NS_USER, and wfGetDB().
Referenced by ExternalUserNames\applyPrefix(), MediaWiki\Auth\AuthManager\autoCreateUser(), CleanupUsersWithNoId\cleanup(), CreateBotPassword\execute(), UsersPager\getQueryInfo(), and MediaWiki\Block\UnblockUser\unblockUnsafe().
User::incEditCount | ( | ) |
Schedule a deferred update to update the user's edit count.
Definition at line 4344 of file User.php.
References DeferredUpdates\addUpdate(), and isAnon().
Referenced by MediaWiki\Storage\PageUpdater\doCreate(), MediaWiki\Storage\PageUpdater\doModify(), and MovePage\moveToInternal().
User::initEditCountInternal | ( | IDatabase | $dbr | ) |
User::invalidateCache | ( | ) |
Immediately touch the user data cache for this account.
Calls touch() and removes account data from memcached
Definition at line 2362 of file User.php.
References clearSharedCache(), and touch().
Referenced by addWatch(), removeWatch(), and setActorId().
User::invalidateEmail | ( | ) |
Invalidate the user's e-mail confirmation, and unauthenticate the e-mail address if it was already confirmed.
Definition at line 4024 of file User.php.
References load(), and setEmailAuthenticationTimestamp().
Referenced by setEmail().
|
protected |
Return a URL the user can use to invalidate their email address.
string | $token | Accepts the email confirmation token |
Definition at line 3976 of file User.php.
References getTokenUrl().
Referenced by sendConfirmationMail().
User::isAllowed | ( | string | $permission | ) |
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.
string | $permission |
Implements MediaWiki\Permissions\Authority.
Definition at line 3119 of file User.php.
References getThisAsAuthority().
Referenced by addWatch(), canSendEmail(), changeableGroups(), ApiQueryRevisions\getRollbackToken(), ApiQueryInfo\getUserToken(), isAllowedToCreateAccount(), isBlockedFromCreateAccount(), isBot(), isNewbie(), isPingLimitable(), and removeWatch().
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.
Definition at line 3115 of file User.php.
References getThisAsAuthority().
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 3111 of file User.php.
References getThisAsAuthority().
Referenced by ApiQueryInfo\getImportToken(), useFilePatrol(), useNPPatrol(), and useRCPatrol().
User::isAllowedToCreateAccount | ( | ) |
Get whether the user is allowed to create an account.
Definition at line 3759 of file User.php.
References isAllowed(), and isBlockedFromCreateAccount().
User::isAllowUsertalk | ( | ) |
Checks if usertalk is allowed.
Definition at line 4500 of file User.php.
References $mAllowUsertalk.
Referenced by MediaWiki\Permissions\PermissionManager\isBlockedFrom().
User::isAnon | ( | ) |
Get whether the user is anonymous.
Definition at line 3073 of file User.php.
References isRegistered().
Referenced by MediaWiki\Session\UserInfo\__construct(), MediaWiki\Storage\PageEditStash\checkCache(), WatchAction\checkCanExecute(), MediaWiki\Permissions\PermissionManager\checkQuickPermissions(), getEditTokenObject(), getExperienceLevel(), getRegistration(), Parser\getUserSig(), incEditCount(), isEmailConfirmed(), CreditsAction\link(), MediaWiki\Session\UserInfo\newFromId(), MediaWiki\Block\BlockManager\trackBlockWithCookie(), and CreditsAction\userLink().
User::isBlocked | ( | $fromReplica = true | ) |
Check if user is blocked.
bool | $fromReplica | Whether to check the replica DB instead of the master. Hacked from false due to horrible probs on site. |
Definition at line 1918 of file User.php.
References getBlock().
User::isBlockedFrom | ( | $title, | |
$fromReplica = false |
|||
) |
Check if user is blocked from editing a particular article.
Title | $title | Title to check |
bool | $fromReplica | Whether to check the replica DB instead of the master |
Definition at line 1946 of file User.php.
References $title.
Referenced by Action\checkCanExecute().
User::isBlockedFromCreateAccount | ( | ) |
Get whether the user is explicitly blocked from account creation.
Definition at line 3715 of file User.php.
References $mBlock, MediaWiki\Block\AbstractBlock\appliesToRight(), getBlockedStatus(), getRequest(), and isAllowed().
Referenced by MediaWiki\Auth\AuthManager\checkAccountCreatePermissions(), and isAllowedToCreateAccount().
User::isBlockedFromEmailuser | ( | ) |
Get whether the user is blocked from using Special:Emailuser.
Definition at line 3739 of file User.php.
References getBlockedStatus().
Referenced by ApiQueryInfo\getEmailToken().
User::isBlockedFromUpload | ( | ) |
Get whether the user is blocked from using Special:Upload.
Definition at line 3750 of file User.php.
References getBlockedStatus().
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 1988 of file User.php.
References getGlobalBlock().
User::isBot | ( | ) |
Definition at line 3081 of file User.php.
References getGroups(), and isAllowed().
Referenced by MediaWiki\Storage\PageEditStash\checkCache(), and getWatchlistValue().
|
static |
Usernames which fail to pass this function will be blocked from new account registrations, but may be used internally either by batch processes or by user accounts which have already been created.
Additional blacklisting may be added here rather than in isValidUserName() to avoid disrupting existing accounts.
string | $name | String to match |
User::isEmailConfirmationPending | ( | ) |
Check whether there is an outstanding request for e-mail confirmation.
Definition at line 4105 of file User.php.
References $wgEmailAuthentication, isEmailConfirmed(), and wfTimestamp().
User::isEmailConfirmed | ( | ) |
Is this user's e-mail address valid-looking and confirmed within limits of the current site configuration?
Definition at line 4079 of file User.php.
References $wgEmailAuthentication, getEmail(), getEmailAuthenticationTimestamp(), isAnon(), load(), and Sanitizer\validateEmail().
Referenced by canReceiveEmail(), canSendEmail(), MediaWiki\Permissions\PermissionManager\checkUserBlock(), confirmEmail(), and isEmailConfirmationPending().
|
private |
Check whether this is the global session user.
Definition at line 4582 of file User.php.
References RequestContext\getMain(), and getName().
Referenced by getBlockedStatus().
User::isHidden | ( | ) |
Check if user account is hidden.
Definition at line 2048 of file User.php.
References $mHideName, and getBlockedStatus().
Referenced by UserrightsPage\fetchUser(), and MediaWiki\Permissions\PermissionManager\isBlockedFrom().
|
static |
Does the string match an anonymous IP address?
This function exists for username validation, in order to reject usernames which are similar in form to IP addresses. Strings such as 300.300.300.300 will return true because it looks like an IP address, despite not being strictly valid.
We match "\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.xxx" as an anonymous IP address because the usemod software would "cloak" anonymous IP addresses like this, if we allowed accounts like this to be created new users could get the old edits of these anonymous users.
string | $name | Name to match |
Definition at line 994 of file User.php.
Referenced by ImageListPager\__construct(), SpecialContributions\contributionsSub(), MediaWiki\Storage\DerivedPageDataUpdater\doUpdates(), SpecialContributions\execute(), ApiQueryUserContribs\execute(), RollbackEdits\execute(), SearchNearMatcher\getNearMatchInternal(), Skin\getRelevantUser(), ReassignEdits\initialiseUser(), MediaWiki\User\UserFactory\newAnonymous(), ApiQueryBlocks\prepareUsername(), EditPage\showIntro(), and Article\showMissingArticle().
User::isIPRange | ( | ) |
Is the user an IP range?
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) |
Definition at line 1241 of file User.php.
References true.
Referenced by getActorId(), getId(), getName(), and getRealName().
User::isLocked | ( | ) |
User::isLoggedIn | ( | ) |
Get whether the user is registered.
Definition at line 3065 of file User.php.
References isRegistered().
User::isNewbie | ( | ) |
Determine whether the user is a newbie.
Newbies are either anonymous IPs, or the most recently created accounts.
Definition at line 3787 of file User.php.
References isAllowed().
Referenced by pingLimiter(), and SpecialEmailUser\validateTarget().
User::isPingLimitable | ( | ) |
Is this user subject to rate limiting?
Definition at line 1659 of file User.php.
References $wgRateLimitsExcludedIPs, getRequest(), and isAllowed().
Referenced by pingLimiter().
User::isRegistered | ( | ) |
Get whether the user is registered.
Implements MediaWiki\User\UserIdentity.
Definition at line 3055 of file User.php.
References getId().
Referenced by MediaWiki\User\UserGroupManager\checkCondition(), WatchAction\doWatchOrUnwatch(), UppercaseTitlesForUnicodeTransition\execute(), ApiQueryInfo\getOptionsToken(), MediaWiki\Block\BlockManager\getUserBlock(), LanguageConverter\getUserVariant(), ApiQueryInfo\getWatchToken(), isAnon(), isLoggedIn(), and spreadAnyEditBlock().
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 341 of file User.php.
References $wgFullyInitialised.
Referenced by LanguageConverter\getUserVariant(), and MediaWiki\Block\BlockManager\trackBlockWithCookie().
User::isSystemUser | ( | ) |
Get whether the user is a system user.
A user is considered to exist as a non-system user if it can authenticate, or has an email set, or has a non-invalid token.
Definition at line 3101 of file User.php.
References getEmail(), and load().
User::isTempWatched | ( | $title, | |
$checkRights = self::CHECK_USER_RIGHTS |
|||
) |
Check if the article is temporarily watched.
Definition at line 3193 of file User.php.
References $title.
Referenced by SkinTemplate\getWatchLinkAttrs().
|
static |
Usernames which fail to pass this function will be blocked from user login and new account registrations, but may be used internally by batch processes.
If an account already exists in this form, login will be blocked by a failure to pass this function.
string | $name | Name to match |
Definition at line 1038 of file User.php.
Referenced by MediaWiki\Session\UserInfo\__construct().
User::isValidPassword | ( | $password | ) |
Is the input a valid password for this user?
string | $password | Desired password |
Definition at line 1103 of file User.php.
References checkPasswordValidity().
|
static |
Is the input a valid username?
Checks if the input is a valid username, we don't want an empty string, an IP address, anything that contains slashes (would mess up subpages), is longer than the maximum allowed username size or doesn't begin with a capital letter.
string | $name | Name to match |
Definition at line 1022 of file User.php.
Referenced by GenderCache\doQuery(), and MediaWiki\Session\SessionBackend\save().
User::isWatched | ( | $title, | |
$checkRights = self::CHECK_USER_RIGHTS |
|||
) |
Check the watched status of an article.
Title | $title | Title of the article to look at |
bool | $checkRights | Whether to check 'viewmywatchlist'/'editmywatchlist' rights. Pass User::CHECK_USER_RIGHTS or User::IGNORE_USER_RIGHTS. |
Definition at line 3176 of file User.php.
References $title.
Referenced by getWatchlistValue().
|
static |
Return a list of the types of user options currently returned by User::getOptionKinds().
Currently, the option kinds are:
The API (and possibly others) use this function to determine the possible option types for validation purposes, so make sure to update this when a new option kind is added.
Definition at line 2796 of file User.php.
Referenced by ApiOptions\getAllowedParams().
User::load | ( | $flags = self::READ_NORMAL | ) |
Load the user table data for this object from the source given by mFrom.
int | $flags | User::READ_* constant bitfield |
Reimplemented in PPFuzzUser.
Definition at line 358 of file User.php.
References $mLoadedItems, $wgFullyInitialised, DBAccessObjectUtils\getDBOptions(), MediaWiki\Logger\LoggerFactory\getInstance(), loadDefaults(), loadFromId(), loadFromSession(), and wfGetDB().
Referenced by addToDatabase(), checkAndSetTouched(), confirmationToken(), createNew(), getActorId(), getBlockedStatus(), getDBTouched(), getEmail(), getEmailAuthenticationTimestamp(), getId(), getName(), getRealName(), getRegistration(), getToken(), getTouched(), RequestContext\importScopedSession(), invalidateEmail(), isEmailConfirmed(), isSystemUser(), MediaWiki\Session\UserInfo\newFromId(), saveSettings(), setCookies(), setEmail(), setEmailAuthenticationTimestamp(), setName(), setRealName(), setToken(), and spreadBlock().
User::loadDefaults | ( | $name = false , |
|
$actorId = null |
|||
) |
Set cached properties to default.
string | bool | $name | |
int | null | $actorId |
Definition at line 1205 of file User.php.
References wfTimestamp().
Referenced by PPFuzzUser\load(), load(), loadFromDatabase(), and loadFromId().
|
protected |
Load user data from shared cache, given mId has already been set.
Definition at line 510 of file User.php.
References $cache, $wgFullyInitialised, DB_REPLICA, getCacheKey(), loadFromDatabase(), VERSION, wfDebug(), wfGetDB(), and wfTimestamp().
Referenced by loadFromId().
User::loadFromDatabase | ( | $flags = self::READ_LATEST | ) |
Load user data from the database.
$this->mId must be set, this is how the user is identified.
int | $flags | User::READ_* constant bitfield |
Definition at line 1290 of file User.php.
References $s, DBAccessObjectUtils\getDBOptions(), getEditCount(), getQueryInfo(), loadDefaults(), loadFromRow(), and wfGetDB().
Referenced by addToDatabase(), loadFromCache(), and loadFromId().
User::loadFromId | ( | $flags = self::READ_NORMAL | ) |
Load user table data, given mId has already been set.
int | $flags | User::READ_* constant bitfield |
Definition at line 446 of file User.php.
References DBAccessObjectUtils\hasFlags(), loadDefaults(), loadFromCache(), and loadFromDatabase().
Referenced by MediaWiki\Auth\AuthManager\autoCreateUser(), and load().
|
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. user_properties Array with properties out of the user_properties table
Definition at line 1342 of file User.php.
References if, setItemLoaded(), wfTimestamp(), and wfTimestampOrNull().
Referenced by loadFromDatabase(), and newFromRow().
|
private |
Load user data from the session.
Definition at line 1264 of file User.php.
References getId(), getName(), getRequest(), getToken(), and loadFromUserObject().
Referenced by load().
|
protected |
Load the data for this user object from another user object.
User | $user |
Definition at line 1450 of file User.php.
Referenced by loadFromSession().
User::logout | ( | ) |
|
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.
IDatabase | $db | |
array | $conditions | WHERE conditions for use with Database::update |
Definition at line 1487 of file User.php.
References Wikimedia\Rdbms\IDatabase\timestamp().
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 | $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 |
Definition at line 3842 of file User.php.
References getEditTokenObject().
Referenced by matchEditTokenNoSuffix().
User::matchEditTokenNoSuffix | ( | $val, | |
$salt = '' , |
|||
$request = null , |
|||
$maxage = null |
|||
) |
Check given value against the token value stored in the session, ignoring the suffix.
string | $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 |
Definition at line 3856 of file User.php.
References matchEditToken().
|
static |
Factory function for fatal permission-denied errors.
string | $permission | User right required |
Definition at line 4444 of file User.php.
References $wgLang, getGroupsWithPermission(), UserGroupMembership\getLink(), RequestContext\getMain(), and StatusValue\newFatal().
Referenced by ApiUpload\checkPermissions(), WatchAction\doUnwatch(), WatchAction\doWatch(), and MediaWiki\Permissions\PermissionManager\missingPermissionError().
|
static |
Static factory method for creation from a given actor ID.
int | $id | Valid actor ID |
Definition at line 638 of file User.php.
Referenced by RecentChange\getPerformer(), DatabaseLogEntry\getPerformer(), and RCDatabaseLogEntry\getPerformer().
|
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 |
bool | string | $dbDomain | remote wiki to which the User/Actor ID applies, or false if none |
Definition at line 682 of file User.php.
Referenced by WikiPage\archiveRevisions(), LocalFile\decodeRow(), LocalFileDeleteBatch\doDBInserts(), LocalFileRestoreBatch\execute(), RecentChange\getAttribute(), ImportableOldRevisionImporter\import(), MediaWiki\Block\DatabaseBlock\initFromRow(), RemoveUnusedAccounts\isInactiveAccount(), RecentChange\loadFromRow(), ArchivedFile\loadFromRow(), RebuildRecentchanges\rebuildRecentChangesTablePass1(), RebuildRecentchanges\rebuildRecentChangesTablePass3(), RecentChange\save(), LocalFile\setProps(), and Revision\setUserIdAndName().
|
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 | User::READ_* bitfield |
|
static |
Static factory method for creation from a given user ID.
int | $id | Valid user ID |
Definition at line 623 of file User.php.
Referenced by MediaWiki\Block\DatabaseBlock\__construct(), LogPage\addEntry(), MediaWiki\Auth\AuthManager\continueAccountCreation(), SpecialRedirect\dispatchUser(), ApiQueryAllUsers\execute(), ChangePassword\execute(), FixUserRegistration\execute(), MigrateUserGroup\execute(), RemoveInvalidEmails\execute(), RemoveUnusedAccounts\execute(), ResetUserEmail\execute(), WrapOldPasswords\execute(), WikiPage\getContributors(), RefreshLinksJob\getDataUpdateOptions(), UsersPager\getGroupMemberships(), getInstanceForUpdate(), NewUsersLogFormatter\getMessageParameters(), RecentChange\getPerformer(), DatabaseLogEntry\getPerformer(), RCDatabaseLogEntry\getPerformer(), RequestContext\importScopedSession(), Installer\resetMediaWikiServices(), DeletePageJob\run(), EnotifNotifyJob\run(), UserOptionsUpdateJob\run(), Skin\showEmailUser(), UserOptionsMaintenance\showUsageStats(), UserOptionsMaintenance\updateOptions(), ResetUserTokens\updateUser(), and Linker\userToolLinks().
|
static |
Returns a User object corresponding to the given UserIdentity.
UserIdentity | $identity |
Definition at line 655 of file User.php.
Referenced by MediaWiki\User\UserGroupManager\addUserToAutopromoteOnceGroups(), MediaWiki\User\UserGroupManager\addUserToGroup(), SpecialBlock\canBlockEmail(), WikiPage\doSecondaryDataUpdates(), MediaWiki\Storage\DerivedPageDataUpdater\doSecondaryDataUpdates(), MediaWiki\Storage\DerivedPageDataUpdater\doUpdates(), MediaWiki\Rest\Handler\MediaFileHandler\getFile(), MediaWiki\User\UserOptionsManager\getOptionKinds(), ManualLogEntry\getPerformer(), MediaWiki\Rest\Handler\MediaFileHandler\getResponse(), CategoryMembershipChange\getUser(), WatchedItem\getUser(), MediaWiki\User\UserGroupManager\getUserAutopromoteGroups(), MediaWiki\User\UserGroupManager\getUserAutopromoteOnceGroups(), MediaWiki\User\UserGroupManager\getUserEffectiveGroups(), MediaWiki\Permissions\PermissionManager\getUserPermissions(), MediaWiki\User\UserOptionsManager\loadUserOptions(), RecentChange\newLogEntry(), MediaWiki\Storage\DerivedPageDataUpdater\prepareContent(), MediaWiki\Rest\Handler\MediaLinksHandler\processDbResults(), MediaWiki\User\UserGroupManager\removeUserFromGroup(), MediaWiki\User\UserOptionsManager\resetOptions(), MediaWiki\User\UserOptionsManager\saveOptions(), and WikiPage\updateParserCache().
|
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. Takes the same parameters as User::getCanonicalName(), except that true is accepted as an alias for 'valid', for BC. |
Definition at line 584 of file User.php.
Referenced by CliInstaller\__construct(), ImageListPager\__construct(), EmailNotification\actuallyNotifyOnPageChange(), MediaWiki\Auth\AuthManager\beginAccountCreation(), MediaWiki\Auth\AuthManager\beginAuthentication(), Parser\braceSubstitution(), ImageListPager\buildQueryConds(), MediaWiki\Auth\AuthManager\canCreateAccount(), EmailNotification\canSendUserTalkEmail(), ApiMain\checkAsserts(), MediaWiki\Auth\AuthManager\continueAccountCreation(), MediaWiki\Auth\AuthManager\continueAccountLink(), MediaWiki\Auth\AuthManager\continueAuthentication(), Installer\createSysop(), MediaWiki\Storage\DerivedPageDataUpdater\doUpdates(), SpecialContributions\execute(), SpecialDeletedContributions\execute(), SpecialLog\execute(), LoginSignupSpecialPage\execute(), BlockUsers\execute(), ChangePassword\execute(), CreateAndPromote\execute(), DeleteBatch\execute(), DeleteDefaultMessages\execute(), EditCLI\execute(), ImportImages\execute(), ImportSiteScripts\execute(), ImportTextFiles\execute(), InvalidateUserSesssions\execute(), MakeTestEdits\execute(), MoveBatch\execute(), Protect\execute(), ResetUserEmail\execute(), TableCleanup\execute(), Undelete\execute(), UppercaseTitlesForUnicodeTransition\execute(), UserrightsPage\fetchUser(), LogFormatter\formatParameterValue(), LogFormatter\formatParameterValueForApi(), BlockListPager\formatValue(), CoreParserFunctions\gender(), CreditsAction\getAuthor(), WikiPage\getContributors(), RefreshLinksJob\getDataUpdateOptions(), WANCacheReapUpdate\getEventAffectedKeys(), BlockLogFormatter\getMessageParameters(), NewUsersLogFormatter\getMessageParameters(), MediaWiki\Auth\AbstractPasswordPrimaryAuthenticationProvider\getNewPasswordExpiry(), RecentChange\getPerformer(), DatabaseLogEntry\getPerformer(), RCDatabaseLogEntry\getPerformer(), ContribsPager\getQueryInfo(), DeletedContribsPager\getQueryInfo(), NewFilesPager\getQueryInfo(), NewPagesPager\getQueryInfo(), Skin\getRelevantUser(), RollbackEdits\getRollbackTitles(), SpecialEmailUser\getTarget(), ContribsPager\getTargetTable(), LocalFile\getUser(), CategoryMembershipChange\getUser(), DoubleRedirectJob\getUser(), DerivativeResourceLoaderContext\getUserObj(), ResourceLoaderContext\getUserObj(), ApiBase\getWatchlistUser(), ImportableOldRevisionImporter\import(), ImportableUploadRevisionImporter\import(), WikiRevision\importLogItem(), RequestContext\importScopedSession(), ReassignEdits\initialiseUser(), LogPager\limitPerformer(), SpecialMute\loadTarget(), CentralIdLookup\localUserFromCentralId(), BotPassword\login(), RequestContext\newExtraneousContext(), WikiPage\onArticleDelete(), RawAction\onView(), InfoAction\pageInfo(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\providerAllowsAuthenticationDataChange(), EnotifNotifyJob\run(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\sendPasswordResetEmail(), MediaWiki\Block\DatabaseBlock\setBlocker(), SpecialLog\show(), EditPage\showIntro(), Article\showMissingArticle(), WebInstallerName\submit(), PageArchive\undeleteRevisions(), and HTMLUserTextField\validate().
|
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 loadFromRow().
Referenced by ApiQueryUsers\execute(), DatabaseLogEntry\getPerformer(), MediaWiki\User\UserFactory\newFromRow(), newSystemUser(), RebuildRecentchanges\rebuildRecentChangesTablePass4(), and UserArrayFromResult\setCurrent().
|
static |
Create a new user object using data from session.
If the login credentials are invalid, the result is an anonymous user.
WebRequest | null | $request | Object to use; the global request will be used if omitted. |
Definition at line 714 of file User.php.
Referenced by RequestContext\getUser().
|
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:
string | $name | Username |
array | $options | Options are:
|
Definition at line 777 of file User.php.
References $dbr, createNew(), DB_MASTER, DB_REPLICA, Wikimedia\Rdbms\IDatabase\delete(), getQueryInfo(), INVALID_TOKEN, newFromRow(), Wikimedia\Rdbms\IDatabase\selectRow(), and Wikimedia\Rdbms\IDatabase\update().
Referenced by ImageBuilder\addMissingImage(), Installer\createMainpage(), AddChangeTag\execute(), BlockUsers\execute(), CleanupCaps\execute(), CleanupSpam\execute(), DeleteBatch\execute(), DeleteDefaultMessages\execute(), DeleteEqualMessages\execute(), EditCLI\execute(), ImportImages\execute(), ImportSiteScripts\execute(), ImportTextFiles\execute(), MoveBatch\execute(), Protect\execute(), RollbackEdits\execute(), TableCleanup\execute(), Undelete\execute(), UppercaseTitlesForUnicodeTransition\execute(), and PopulateArchiveRevId\makeDummyRevisionRow().
|
private |
Generate a current or new-future timestamp to be stored in the user_touched field when we update things.
Definition at line 2317 of file User.php.
References wfTimestamp().
Referenced by addToDatabase(), checkAndSetTouched(), and saveSettings().
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] |
MWException |
Definition at line 1686 of file User.php.
References $cache, $keys, $wgRateLimits, CentralIdLookup\AUDIENCE_RAW, CentralIdLookup\factoryNonLocal(), getGroups(), getId(), MediaWiki\Logger\LoggerFactory\getInstance(), ObjectCache\getLocalClusterInstance(), getName(), getRequest(), isNewbie(), and isPingLimitable().
Referenced by SpecialChangeEmail\attemptChange(), ContentModelChange\doContentModelChange(), PasswordReset\execute(), and ChangeTags\updateTagsWithChecks().
User::probablyCan | ( | string | $action, |
PageIdentity | $target, | ||
PermissionStatus | $status = null |
||
) |
@unstable this is a part of the Authority experiment and should not be used yet.
string | $action | |
PageIdentity | $target | |
PermissionStatus | null | $status |
Implements MediaWiki\Permissions\Authority.
Definition at line 4519 of file User.php.
References getThisAsAuthority().
|
static |
string | $dbDomain | |
int | $userId |
Definition at line 476 of file User.php.
References $cache.
Referenced by UserRightsProxy\invalidateCache().
User::removeGroup | ( | $group | ) |
Remove the user from the given group.
This takes immediate effect.
string | $group | Name of the group to remove |
User::removeWatch | ( | $title, | |
$checkRights = self::CHECK_USER_RIGHTS |
|||
) |
Stop watching an article.
Title | $title | Title of the article to look at |
bool | $checkRights | Whether to check 'viewmywatchlist'/'editmywatchlist' rights. Pass User::CHECK_USER_RIGHTS or User::IGNORE_USER_RIGHTS. |
Definition at line 3236 of file User.php.
References $title, invalidateCache(), and isAllowed().
User::requiresHTTPS | ( | ) |
Determine based on the wiki configuration and the user's options, whether this user must be over HTTPS no matter what.
Definition at line 2873 of file User.php.
References $wgForceHTTPS, $wgSecureLogin, getBoolOption(), getRequest(), and wfCanIPUseHTTPS().
|
static |
User::resetOptions | ( | $resetKinds = [ 'registered' , |
|
'registered-multiselect' | , | ||
'registered-checkmatrix' | , | ||
'unused'] | , | ||
IContextSource | $context = null |
||
) |
Reset certain (or all) options to the site defaults.
The optional parameter determines which kinds of preferences will be reset. Supported values are everything that can be reported by getOptionKinds() and 'all', which forces a reset of all preferences and overrides everything else.
array | string | $resetKinds | Which kinds of preferences to reset. Defaults to [ 'registered', 'registered-multiselect', 'registered-checkmatrix', 'unused' ] for backwards-compatibility. |
IContextSource | null | $context | Context source used when $resetKinds does not contain 'all', passed to getOptionKinds(). Defaults to RequestContext::getMain() when null. |
Definition at line 2836 of file User.php.
References RequestContext\getMain().
User::resetTokenFromOption | ( | $oname | ) |
Reset a token stored in the preferences (like the watchlist one).
Does not save user's preferences (similarly to setOption()).
string | $oname | The option name to reset the token in |
Definition at line 2761 of file User.php.
References $wgHiddenPrefs, MWCryptRand\generateHex(), and setOption().
User::saveSettings | ( | ) |
Save this user's settings into the database.
Definition at line 3416 of file User.php.
References Wikimedia\Rdbms\IDatabase\affectedRows(), clearSharedCache(), DB_MASTER, getUserPage(), if, load(), MWExceptionHandler\logException(), newTouchedTimestamp(), Wikimedia\Rdbms\IDatabase\timestamp(), Wikimedia\Rdbms\IDatabase\timestampOrNull(), Wikimedia\Rdbms\IDatabase\update(), wfGetDB(), and wfReadOnly().
Referenced by MediaWiki\Auth\AuthManager\autoCreateUser(), MediaWiki\Session\SessionManager\invalidateSessionsForUser(), MediaWiki\Session\SessionBackend\save(), and sendConfirmationMail().
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 3868 of file User.php.
References $type, $wgLang, confirmationToken(), confirmationTokenUrl(), getName(), getRequest(), invalidationTokenUrl(), saveSettings(), sendMail(), and wfMessage().
Referenced by setEmailWithConfirmation().
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 | $body | Message body |
User | null | $from | Optional sending user; if unspecified, default $wgPasswordSender will be used. |
MailAddress | null | $replyto | Reply-To address |
Definition at line 3923 of file User.php.
References $wgPasswordSender, MailAddress\newFromUser(), UserMailer\send(), and wfMessage().
Referenced by sendConfirmationMail(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\sendNewAccountEmail(), and setEmailWithConfirmation().
User::setActorId | ( | int | $actorId | ) |
Sets the actor id.
This method is deprecated upon introduction. It only exists for transition to ActorStore, and will be removed shortly - T274148
Definition at line 2186 of file User.php.
References invalidateCache(), and setItemLoaded().
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 |
Definition at line 3332 of file User.php.
References MediaWiki\Logger\LoggerFactory\getInstance(), getRequest(), and load().
User::setEditCountInternal | ( | $count | ) |
User::setEmail | ( | $str | ) |
Set the user's e-mail address.
string | $str | New e-mail address |
Definition at line 2553 of file User.php.
References getEmail(), invalidateEmail(), and load().
Referenced by setEmailWithConfirmation().
User::setEmailAuthenticationTimestamp | ( | $timestamp | ) |
Set the e-mail authentication timestamp.
string | null | $timestamp | TS_MW timestamp |
Definition at line 4038 of file User.php.
References load().
Referenced by confirmEmail(), and invalidateEmail().
User::setEmailWithConfirmation | ( | $str | ) |
Set the user's e-mail address and a confirmation mail if needed.
string | $str | New e-mail address |
Definition at line 2570 of file User.php.
References $type, $wgEmailAuthentication, $wgEnableEmail, getEmail(), getName(), getRequest(), StatusValue\newFatal(), StatusValue\newGood(), sendConfirmationMail(), sendMail(), setEmail(), and wfMessage().
User::setId | ( | $v | ) |
Set the user and reload all fields according to a given ID.
int | $v | User ID to reload |
Definition at line 2098 of file User.php.
References clearInstanceCache().
Referenced by MediaWiki\Auth\AuthManager\autoCreateUser().
User::setItemLoaded | ( | $item | ) |
Set that an item has been loaded.
Definition at line 1253 of file User.php.
Referenced by loadFromRow(), MediaWiki\User\UserFactory\newFromAnyId(), and setActorId().
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 |
Definition at line 2135 of file User.php.
References load().
Referenced by MediaWiki\Auth\AuthManager\continueAccountCreation().
User::setNewtalk | ( | $val, | |
$curRev = null |
|||
) |
Update the 'You have new messages!' status.
bool | $val | Whether the user has new messages |
RevisionRecord | Revision | null | $curRev | New, as yet unseen revision of the user talk page. Ignored if null or !$val |
Definition at line 2295 of file User.php.
References wfDeprecated().
User::setOption | ( | $oname, | |
$val | |||
) |
Set the given option for a user.
You need to call saveSettings() to actually write to the database.
string | $oname | The option to set |
mixed | $val | New value to set |
Definition at line 2717 of file User.php.
Referenced by __set(), resetTokenFromOption(), and MediaWiki\Auth\AuthManager\setDefaultUserOptions().
User::setRealName | ( | $str | ) |
User::setToken | ( | $token = false | ) |
Set the random token (used for persistent authentication) Called from loadDefaults() among other places.
string | bool | $token | If specified, set the token to this value |
Definition at line 2516 of file User.php.
References MWCryptRand\generateHex(), MediaWiki\Logger\LoggerFactory\getInstance(), and load().
Referenced by addToDatabase(), getToken(), MediaWiki\Session\SessionManager\invalidateSessionsForUser(), and MediaWiki\Auth\AuthManager\setDefaultUserOptions().
User::spreadAnyEditBlock | ( | ) |
If this user is logged-in and blocked, block any IP address they've successfully logged in from.
Definition at line 3683 of file User.php.
References getBlock(), isRegistered(), and spreadBlock().
Referenced by MovePage\moveIfAllowed().
|
protected |
If this (non-anonymous) user is blocked, block the IP address they've successfully logged in from.
Definition at line 3696 of file User.php.
References getName(), getRequest(), load(), and wfDebug().
Referenced by spreadAnyEditBlock().
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.
Definition at line 2379 of file User.php.
References $cache, and getId().
Referenced by invalidateCache().
|
private |
Update the actor ID after an insert.
IDatabase | $dbw | Writable database handle |
Definition at line 3669 of file User.php.
References Wikimedia\Rdbms\IDatabase\insert(), and Wikimedia\Rdbms\IDatabase\insertId().
Referenced by addToDatabase().
User::useFilePatrol | ( | ) |
Check whether to enable new files patrol features for this user.
Definition at line 3148 of file User.php.
References $wgUseFilePatrol, $wgUseRCPatrol, and isAllowedAny().
Referenced by ChangesList\isUnpatrolled().
User::useNPPatrol | ( | ) |
Check whether to enable new pages patrol features for this user.
Definition at line 3136 of file User.php.
References $wgUseNPPatrol, $wgUseRCPatrol, and isAllowedAny().
Referenced by ApiQueryRecentChanges\getPatrolToken(), WatchedItemQueryService\getWatchedItemsWithRCInfoQueryFilterConds(), ChangesList\isUnpatrolled(), and MediaWiki\Preferences\DefaultPreferencesFactory\rcPreferences().
User::useRCPatrol | ( | ) |
Check whether to enable recent changes patrol features for this user.
Definition at line 3127 of file User.php.
References $wgUseRCPatrol, and isAllowedAny().
Referenced by ApiQueryRecentChanges\getPatrolToken(), WatchedItemQueryService\getWatchedItemsWithRCInfoQueryFilterConds(), ChangesList\isUnpatrolled(), MediaWiki\Preferences\DefaultPreferencesFactory\rcPreferences(), and MediaWiki\Preferences\DefaultPreferencesFactory\watchlistPreferences().
User::validateCache | ( | $timestamp | ) |
Validate the cache for this account.
string | $timestamp | A timestamp in TS_MW format |
Definition at line 2394 of file User.php.
References getTouched().
|
static |
Get the username corresponding to a given user ID.
int | $id | User ID |
Definition at line 910 of file User.php.
References UserCache\singleton().
Referenced by ApiBlock\execute(), and UserrightsPage\fetchUser().
|
static |
Get the real name of a user given their user ID.
int | $id | User ID |
Definition at line 920 of file User.php.
References UserCache\singleton().
int null User::$mActorId |
Switched from protected to public for use in UserFactory.
Definition at line 140 of file User.php.
Referenced by getActorId().
|
protected |
Definition at line 226 of file User.php.
Referenced by isAllowUsertalk().
AbstractBlock null User::$mBlock |
Definition at line 223 of file User.php.
Referenced by isBlockedFromCreateAccount().
string int User::$mBlockedby |
Definition at line 194 of file User.php.
Referenced by blockedBy().
|
private |
|
protected |
TODO: This should be removed when User::BlockedFor and AbstractBlock::getReason are hard deprecated.
Definition at line 202 of file User.php.
Referenced by blockedFor().
|
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 |
Lazy-initialized variables, invalidated with clearInstanceCache.
Definition at line 187 of file User.php.
Referenced by getDatePreference().
|
protected |
Definition at line 161 of file User.php.
Referenced by getEditCount().
string User::$mEmail |
Definition at line 145 of file User.php.
Referenced by getEmail().
string User::$mEmailAuthenticated |
Definition at line 153 of file User.php.
Referenced by getEmailAuthenticationTimestamp().
string User::$mFrom |
Initialization data source if mLoadedItems!==true.
May be one of:
Use the User::newFrom*() family of functions to set this.
|
protected |
bool User::$mHideName |
Definition at line 213 of file User.php.
Referenced by isHidden().
int User::$mId |
Cache variables.
Definition at line 132 of file User.php.
Referenced by addToDatabase(), and getId().
|
protected |
|
protected |
Definition at line 206 of file User.php.
Referenced by isLocked().
string User::$mName |
Definition at line 134 of file User.php.
Referenced by addToDatabase(), and getName().
|
protected |
string User::$mRealName |
Definition at line 142 of file User.php.
Referenced by getRealName().
|
protected |
Definition at line 159 of file User.php.
Referenced by getRegistration().
|
private |
Definition at line 216 of file User.php.
Referenced by getRequest().
|
private |
lazy-initialized Authority of this user
Definition at line 235 of file User.php.
Referenced by getThisAsAuthority().
|
protected |
Definition at line 151 of file User.php.
Referenced by getToken().
string User::$mTouched |
TS_MW timestamp from the DB.
Definition at line 147 of file User.php.
Referenced by getDBTouched(), and getTouched().
|
protected |
const User::CHECK_USER_RIGHTS = true |
const User::GETOPTIONS_EXCLUDE_DEFAULTS = UserOptionsLookup::EXCLUDE_DEFAULTS |
Exclude user options that are set to their default value.
Definition at line 91 of file User.php.
Referenced by ResourceLoaderUserOptionsModule\getScript().
const User::IGNORE_USER_RIGHTS = false |
Definition at line 101 of file User.php.
Referenced by MediaWiki\Auth\AuthManager\autoCreateUser(), MediaWiki\Auth\AuthManager\continueAccountCreation(), WatchAction\doWatchOrUnwatch(), getWatchlistValue(), RollbackAction\handleRollbackRequest(), UploadBase\performUpload(), and SpecialBlock\processFormInternal().
const User::INVALID_TOKEN = '*** INVALID ***' |
An invalid string value for the user_token field.
Definition at line 78 of file User.php.
Referenced by newSystemUser().
const User::TOKEN_LENGTH = 32 |
Number of characters required for the user_token field.
Definition at line 73 of file User.php.
Referenced by BotPassword\save().
|
private |
Version number to tag cached versions of serialized User objects.
Should be increased when $mCacheVars or one of it's members changes.
Definition at line 84 of file User.php.
Referenced by loadFromCache().