MediaWiki
REL1_19
|
The User object encapsulates all of the user-specific settings (user_id, name, rights, password, email address, options, last login time). More...
Public Member Functions | |
__construct () | |
Lightweight constructor for an anonymous user. | |
__toString () | |
addAutopromoteOnceGroups ($event) | |
Add the user to the group if he/she meets given criteria. | |
addGroup ($group) | |
Add the user to the given group. | |
addNewUserLogEntry ($byEmail=false, $reason= '') | |
Add a newuser log entry for this user. | |
addNewUserLogEntryAutoCreate () | |
Add an autocreate newuser log entry for this user Used by things like CentralAuth and perhaps other authplugins. | |
addToDatabase () | |
Add this existing user object to the database. | |
addWatch ($title) | |
Watch an article. | |
blockedBy () | |
If user is blocked, return the name of the user who placed the block. | |
blockedFor () | |
If user is blocked, return the specified reason for the block. | |
canReceiveEmail () | |
Is this user allowed to receive e-mails within limits of current site configuration? | |
canSendEmail () | |
Is this user allowed to send e-mails within limits of current site configuration? | |
changeableGroups () | |
Returns an array of groups that this user can add and remove. | |
checkPassword ($password) | |
Check to see if the given clear-text password is one of the accepted passwords. | |
checkTemporaryPassword ($plaintext) | |
Check if the given clear-text password matches the temporary password sent by e-mail for password reset operations. | |
clearAllNotifications () | |
Resets all of the given user's page-change notification timestamps. | |
clearInstanceCache ($reloadFrom=false) | |
Clear various cached data stored in this object. | |
clearNotification (&$title) | |
Clear the user's notification timestamp for the given title. | |
confirmEmail () | |
Mark the e-mail address confirmed. | |
doLogout () | |
Clear the user's cookies and session, and reset the instance cache. | |
editToken ($salt= '', $request=null) | |
Alias for getEditToken. | |
getAutomaticGroups ($recache=false) | |
Get the list of implicit group memberships this user has. | |
getBlock ($bFromSlave=true) | |
Get the block affecting the user, or null if the user is not blocked. | |
getBlockId () | |
If user is blocked, return the ID for the block. | |
getBoolOption ($oname) | |
Get the user's current setting for a given option, as a boolean value. | |
getDatePreference () | |
Get the user's preferred date format. | |
getEditCount () | |
Get the user's edit count. | |
getEditToken ($salt= '', $request=null) | |
Initialize (if necessary) and return a session token value which can be used in edit forms to show that the user's login credentials aren't being hijacked with a foreign form submission. | |
getEffectiveGroups ($recache=false) | |
Get the list of implicit group memberships this user has. | |
getEmail () | |
Get the user's e-mail address. | |
getEmailAuthenticationTimestamp () | |
Get the timestamp of the user's e-mail authentication. | |
getFirstEditTimestamp () | |
Get the timestamp of the first edit. | |
getFormerGroups () | |
Returns the groups the user has belonged to. | |
getGroups () | |
Get the list of explicit group memberships this user has. | |
getId () | |
Get the user's ID. | |
getIntOption ($oname, $defaultOverride=0) | |
Get the user's current setting for a given option, as a boolean value. | |
getName () | |
Get the user name, or the IP of an anonymous user. | |
getNewMessageLinks () | |
Return the talk page(s) this user has new messages on. | |
getNewtalk () | |
Check if the user has new messages. | |
getOption ($oname, $defaultOverride=null, $ignoreHidden=false) | |
Get the user's current setting for a given option. | |
getOptions () | |
Get all user's options. | |
getPageRenderingHash () | |
Generate a string which will be different for any combination of user options which would produce different parser output. | |
getPasswordValidity ($password) | |
Given unvalidated password input, return error message on failure. | |
getRealName () | |
Get the user's real name. | |
getRegistration () | |
Get the timestamp of account creation. | |
getRequest () | |
Get the WebRequest object to use with this object. | |
getRights () | |
Get the permissions this user has. | |
getSkin () | |
Get the current skin, loading it if required. | |
getStubThreshold () | |
Get the user preferred stub threshold. | |
getTalkPage () | |
Get this user's talk page title. | |
getTitleKey () | |
Get the user's name escaped by underscores. | |
getToken ($forceCreation=true) | |
Get the user's current token. | |
getTouched () | |
Get the user touched timestamp. | |
getUserPage () | |
Get this user's personal page title. | |
idForName () | |
If only this user's username is known, and it exists, return the user ID. | |
incEditCount () | |
Increment the user's edit-count field. | |
inDnsBlacklist ($ip, $bases) | |
Whether the given IP is in a given DNS blacklist. | |
invalidateCache () | |
Immediately touch the user data cache for this account. | |
invalidateEmail () | |
Invalidate the user's e-mail confirmation, and unauthenticate the e-mail address if it was already confirmed. | |
isAllowed ($action= '') | |
Internal mechanics of testing a permission. | |
isAllowedAll () | |
isAllowedAny () | |
Check if user is allowed to access a feature / make an action. | |
isAllowedToCreateAccount () | |
Get whether the user is allowed to create an account. | |
isAnon () | |
Get whether the user is anonymous. | |
isBlocked ($bFromSlave=true) | |
Check if user is blocked. | |
isBlockedFrom ($title, $bFromSlave=false) | |
Check if user is blocked from editing a particular article. | |
isBlockedFromCreateAccount () | |
Get whether the user is explicitly blocked from account creation. | |
isBlockedFromEmailuser () | |
Get whether the user is blocked from using Special:Emailuser. | |
isBlockedGlobally ($ip= '') | |
Check if user is blocked on all wikis. | |
isDnsBlacklisted ($ip, $checkWhitelist=false) | |
Whether the given IP is in a DNS blacklist. | |
isEmailConfirmationPending () | |
Check whether there is an outstanding request for e-mail confirmation. | |
isEmailConfirmed () | |
Is this user's e-mail address valid-looking and confirmed within limits of the current site configuration? | |
isHidden () | |
Check if user account is hidden. | |
isItemLoaded ($item, $all= 'all') | |
Return whether an item has been loaded. | |
isLocked () | |
Check if user account is locked. | |
isLoggedIn () | |
Get whether the user is logged in. | |
isNewbie () | |
Determine whether the user is a newbie. | |
isPasswordReminderThrottled () | |
Has password reminder email been sent within the last $wgPasswordReminderResendTime hours? | |
isPingLimitable () | |
Is this user subject to rate limiting? | |
isValidPassword ($password) | |
Is the input a valid password for this user? | |
isWatched ($title) | |
Check the watched status of an article. | |
load () | |
Load the user table data for this object from the source given by mFrom. | |
loadDefaults ($name=false) | |
Set cached properties to default. | |
loadFromDatabase () | |
Load user and user_group data from the database. | |
loadFromId () | |
Load user table data, given mId has already been set. | |
loadFromRow ($row) | |
Initialize this object from a row from the user table. | |
logout () | |
Log this user out. | |
matchEditToken ($val, $salt= '', $request=null) | |
Check given value against the token value stored in the session. | |
matchEditTokenNoSuffix ($val, $salt= '', $request=null) | |
Check given value against the token value stored in the session, ignoring the suffix. | |
pingLimiter ($action= 'edit') | |
Primitive rate limits: enforce maximum actions per time period to put a brake on flooding. | |
removeGroup ($group) | |
Remove the user from the given group. | |
removeWatch ($title) | |
Stop watching an article. | |
resetOptions () | |
Reset all options to the site defaults. | |
saveSettings () | |
Save this user's settings into the database. | |
saveToCache () | |
Save user data to the shared cache. | |
sendConfirmationMail ($type= 'created') | |
Generate a new e-mail confirmation token and send a confirmation/invalidation mail to the user's given address. | |
sendMail ($subject, $body, $from=null, $replyto=null) | |
Send an e-mail to this user's account. | |
setCookies ($request=null) | |
Set the default cookies for this session on the user's client. | |
setEmail ($str) | |
Set the user's e-mail address. | |
setEmailAuthenticationTimestamp ($timestamp) | |
Set the e-mail authentication timestamp. | |
setId ($v) | |
Set the user and reload all fields according to a given ID. | |
setInternalPassword ($str) | |
Set the password and reset the random token unconditionally. | |
setName ($str) | |
Set the user name. | |
setNewpassword ($str, $throttle=true) | |
Set the password for a password reminder or new account email. | |
setNewtalk ($val) | |
Update the 'You have new messages!' status. | |
setOption ($oname, $val) | |
Set the given option for a user. | |
setPassword ($str) | |
Set the password and reset the random token. | |
setRealName ($str) | |
Set the user's real name. | |
setToken ($token=false) | |
Set the random token (used for persistent authentication) Called from loadDefaults() among other places. | |
spreadAnyEditBlock () | |
If this user is logged-in and blocked, block any IP address they've successfully logged in from. | |
useNPPatrol () | |
Check whether to enable new pages patrol features for this user. | |
useRCPatrol () | |
Check whether to enable recent changes patrol features for this user. | |
validateCache ($timestamp) | |
Validate the cache for this account. | |
Static Public Member Functions | |
static | changeableByGroup ($group) |
Returns an array of the groups that a particular group can add/remove. | |
static | comparePasswords ($hash, $password, $userId=false) |
Compare a password hash with a plain-text password. | |
static | createNew ($name, $params=array()) |
Add a user to the database, return the user object. | |
static | crypt ($password, $salt=false) |
Make a new-style password hash. | |
static | edits ($uid) |
Count the number of edits of a user. | |
static | generateToken ($salt= '') |
Generate a looking random token for various uses. | |
static | getAllGroups () |
Return the set of defined explicit groups. | |
static | getAllRights () |
Get a list of all available permissions. | |
static | getCanonicalName ($name, $validate= 'valid') |
Given unvalidated user input, return a canonical username, or false if the username is invalid. | |
static | getDefaultOption ($opt) |
Get a given default option value. | |
static | getDefaultOptions () |
Combine the language default options with any site-specific options and add the default language variants. | |
static | getGroupMember ($group, $username= '#') |
Get the localized descriptive name for a member of a group, if it exists. | |
static | getGroupName ($group) |
Get the localized descriptive name for a group, if it exists. | |
static | getGroupPage ($group) |
Get the title of a page describing a particular group. | |
static | getGroupPermissions ($groups) |
Get the permissions associated with a given list of groups. | |
static | getGroupsWithPermission ($role) |
Get all the groups who have a given permission. | |
static | getImplicitGroups () |
Get a list of implicit groups. | |
static | getRightDescription ($right) |
Get the description of a given right. | |
static | idFromName ($name) |
Get database id given a user name. | |
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. | |
static | isIP ($name) |
Does the string match an anonymous IPv4 address? | |
static | isLocallyBlockedProxy ($ip) |
Check if an IP address is in the local proxy list. | |
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. | |
static | isValidEmailAddr ($addr) |
Does a string look like an e-mail address? | |
static | isValidUserName ($name) |
Is the input a valid username? | |
static | makeGroupLinkHTML ($group, $text= '') |
Create a link to the group in HTML, if available; else return the group name. | |
static | makeGroupLinkWiki ($group, $text= '') |
Create a link to the group in Wikitext, if available; else return the group name. | |
static | oldCrypt ($password, $userId) |
Make an old-style password hash. | |
static | passwordChangeInputAttribs () |
Provide an array of HTML5 attributes to put on an input element intended for the user to enter a new password. | |
static | randomPassword () |
Return a random password. | |
static | resetIdByNameCache () |
Reset the cache used in idFromName(). | |
static | whoIs ($id) |
Get the username corresponding to a given user ID. | |
static | whoIsReal ($id) |
Get the real name of a user given their user ID. | |
newFrom*() static factory methods | |
static | newFromName ($name, $validate= 'valid') |
Static factory method for creation from username. | |
static | newFromId ($id) |
Static factory method for creation from a given user ID. | |
static | newFromConfirmationCode ($code) |
Factory method to fetch whichever user has a given email confirmation code. | |
static | newFromSession (WebRequest $request=null) |
Create a new user object using data from session or cookies. | |
static | newFromRow ($row) |
Create a new user object from a user row. | |
Public Attributes | |
$mBlock | |
$mBlockedby | |
$mBlockedGlobally | |
$mBlockreason | |
$mDatePreference | |
$mEffectiveGroups | |
$mFormerGroups | |
$mFrom | |
String Initialization data source if mLoadedItems!==true. | |
$mHash | |
$mHideName | |
$mImplicitGroups | |
$mLocked | |
$mNewtalk | |
Lazy-initialized variables, invalidated with clearInstanceCache. | |
$mOptions | |
$mRights | |
const | EDIT_TOKEN_SUFFIX = EDIT_TOKEN_SUFFIX |
const | MW_USER_VERSION = MW_USER_VERSION |
const | USER_TOKEN_LENGTH = USER_TOKEN_LENGTH |
Global constants made accessible as class constants so that autoloader magic can be used. | |
Cache variables | |
$mId | |
$mName | |
$mRealName | |
$mPassword | |
$mNewpassword | |
$mNewpassTime | |
$mEmail | |
$mTouched | |
$mToken | |
$mEmailAuthenticated | |
$mEmailToken | |
$mEmailTokenExpires | |
$mRegistration | |
$mGroups | |
$mOptionOverrides | |
$mCookiePassword | |
$mEditCount | |
$mAllowUsertalk | |
Static Public Attributes | |
static | $idCacheByName = array() |
static | $mAllRights = false |
String Cached results of getAllRights() | |
static | $mCacheVars |
Array of Strings List of member variables which are saved to the shared cache (memcached). | |
static | $mCoreRights |
Array of Strings Core rights. | |
Protected Member Functions | |
checkNewtalk ($field, $id, $fromMaster=false) | |
Internal uncached check for new messages. | |
clearCookie ($name) | |
Clear a cookie on the user's client. | |
compareSecrets ($answer, $test) | |
A comparison of two strings, not vulnerable to timing attacks. | |
deleteNewtalk ($field, $id) | |
Clear the new messages flag for the given user. | |
getTokenUrl ($page, $token) | |
Internal function to format the e-mail validation/invalidation URLs. | |
loadFromUserObject ($user) | |
Load the data for this user object from another user object. | |
loadOptions () | |
saveOptions () | |
setCookie ($name, $value, $exp=0) | |
Set a cookie on the user's client. | |
spreadBlock () | |
If this (non-anonymous) user is blocked, block the IP address they've successfully logged in from. | |
updateNewtalk ($field, $id) | |
Add or update the new messages flag. | |
Private Member Functions | |
clearSharedCache () | |
Clear user data from memcached. | |
confirmationToken (&$expiration) | |
Generate, store, and return a new e-mail confirmation code. | |
confirmationTokenUrl ($token) | |
Return a URL the user can use to confirm their email address. | |
decodeOptions ($str) | |
Set this user's options from an encoded string. | |
getBlockedStatus ($bFromSlave=true) | |
Get blocking information. | |
invalidationTokenUrl ($token) | |
Return a URL the user can use to invalidate their email address. | |
loadFromSession () | |
Load user data from the session or login cookie. | |
loadGroups () | |
Load the groups from the database if they aren't already loaded. | |
setCookiePassword ($str) | |
Set the cookie password. | |
setItemLoaded ($item) | |
Set that an item has been loaded. | |
Static Private Member Functions | |
static | newTouchedTimestamp () |
Generate a current or new-future timestamp to be stored in the user_touched field when we update things. | |
Private Attributes | |
$mBlockedFromCreateAccount = false | |
$mRequest | |
$mOptionsLoaded | |
Bool Whether the cache variables have been loaded. | |
$mLoadedItems = array() | |
Array with already loaded items or true if all items have been loaded. |
The User object encapsulates all of the user-specific settings (user_id, name, rights, password, 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.
Lightweight constructor for an anonymous user.
Use the User::newFrom* factory functions for other kinds of users.
Definition at line 229 of file User.php.
References clearInstanceCache().
User::__toString | ( | ) |
User::addAutopromoteOnceGroups | ( | $ | event | ) |
Add the user to the group if he/she meets given criteria.
Contrary to autopromotion by $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.
$event | String key in $wgAutopromoteOnce (each one has groups/criteria) |
Definition at line 1177 of file User.php.
References $wgAutopromoteOnceLogInRC, addGroup(), Autopromote\getAutopromoteOnceGroups(), getGroups(), getId(), and getUserPage().
User::addGroup | ( | $ | group | ) |
Add the user to the given group.
This takes immediate effect.
$group | String Name of the group to add |
Definition at line 2435 of file User.php.
References getEffectiveGroups(), getGroupPermissions(), getId(), invalidateCache(), loadGroups(), wfGetDB(), and wfRunHooks().
Referenced by addAutopromoteOnceGroups(), and UserTest\setUpUser().
User::addNewUserLogEntry | ( | $ | byEmail = false , |
$ | reason = '' |
||
) |
Add a newuser log entry for this user.
Before 1.19 the return value was always true.
$byEmail | Boolean: account made by email? |
$reason | String: user supplied reason |
Definition at line 3947 of file User.php.
References $wgContLang, $wgNewUserLog, $wgUser, getId(), getName(), getUserPage(), and wfMsgForContent().
Add an autocreate newuser log entry for this user Used by things like CentralAuth and perhaps other authplugins.
Definition at line 3981 of file User.php.
References $wgNewUserLog, getId(), and getUserPage().
Add this existing user object to the database.
Definition at line 2945 of file User.php.
References clearInstanceCache(), load(), saveOptions(), and wfGetDB().
User::addWatch | ( | $ | title | ) |
Watch an article.
$title | Title of the article to look at |
Definition at line 2611 of file User.php.
References $title, WatchedItem\fromUserTitle(), and invalidateCache().
Referenced by WatchAction\doWatch().
User::blockedBy | ( | ) |
If user is blocked, return the name of the user who placed the block.
Definition at line 1611 of file User.php.
References getBlockedStatus().
Referenced by SpecialBlock\checkUnblockSelf().
User::blockedFor | ( | ) |
If user is blocked, return the specified reason for the block.
Definition at line 1620 of file User.php.
References getBlockedStatus().
Is this user allowed to receive e-mails within limits of current site configuration?
Definition at line 3452 of file User.php.
References getOption(), and isEmailConfirmed().
Is this user allowed to send e-mails within limits of current site configuration?
Definition at line 3437 of file User.php.
References $wgEnableEmail, $wgEnableUserEmail, isAllowed(), isEmailConfirmed(), and wfRunHooks().
static User::changeableByGroup | ( | $ | group | ) | [static] |
Returns an array of the groups that a particular group can add/remove.
$group | String: the group to check for whether it can add/remove |
Definition at line 3709 of file User.php.
References $wgAddGroups, $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf, $wgRemoveGroups, and getAllGroups().
Referenced by changeableGroups().
Returns an array of groups that this user can add and remove.
Definition at line 3773 of file User.php.
References changeableByGroup(), getAllGroups(), getEffectiveGroups(), and isAllowed().
User::checkNewtalk | ( | $ | field, |
$ | id, | ||
$ | fromMaster = false |
||
) | [protected] |
Internal uncached check for new messages.
$field | String 'user_ip' for anonymous users, 'user_id' otherwise |
$id | String|Int User's IP address for anonymous users, User ID otherwise |
$fromMaster | Bool true to fetch from the master, false for a slave |
Definition at line 1818 of file User.php.
References $ok, and wfGetDB().
Referenced by getNewtalk().
User::checkPassword | ( | $ | password | ) |
Check to see if the given clear-text password is one of the accepted passwords.
$password | String: user password. |
Definition at line 3128 of file User.php.
References $wgAuth, $wgLegacyEncoding, isValidPassword(), and load().
Referenced by SpecialChangeEmail\attemptChange().
User::checkTemporaryPassword | ( | $ | plaintext | ) |
Check if the given clear-text password matches the temporary password sent by e-mail for password reset operations.
$plaintext | string |
Definition at line 3173 of file User.php.
References $wgNewPasswordExpiry, getId(), load(), and wfTimestamp().
Referenced by SpecialChangeEmail\attemptChange().
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 2690 of file User.php.
References $wgShowUpdatedMarker, $wgUseEnotif, getId(), setNewtalk(), and wfGetDB().
User::clearCookie | ( | $ | name | ) | [protected] |
Clear a cookie on the user's client.
$name | String Name of the cookie to clear |
Definition at line 2754 of file User.php.
References setCookie().
Referenced by doLogout(), and setCookies().
User::clearInstanceCache | ( | $ | reloadFrom = false | ) |
Clear various cached data stored in this object.
$reloadFrom | bool|String Reload user and user_groups table data from a given source. May be "name", "id", "defaults", "session", or false for no reload. |
Definition at line 1208 of file User.php.
Referenced by __construct(), addToDatabase(), doLogout(), and setId().
User::clearNotification | ( | &$ | title | ) |
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 of the article to look at |
Definition at line 2633 of file User.php.
References $title, $wgShowUpdatedMarker, $wgUseEnotif, getName(), isAnon(), isWatched(), setNewtalk(), wfGetDB(), wfReadOnly(), and wfRunHooks().
Referenced by WikiPage\doViewUpdates().
User::clearSharedCache | ( | ) | [private] |
Clear user data from memcached.
Use after applying fun updates to the database; caller's responsibility to update user_touched if appropriate.
Called implicitly from invalidateCache() and saveSettings().
Definition at line 1925 of file User.php.
References $wgMemc, load(), and wfMemcKey().
Referenced by invalidateCache(), and saveSettings().
static User::comparePasswords | ( | $ | hash, |
$ | password, | ||
$ | userId = false |
||
) | [static] |
Compare a password hash with a plain-text password.
Requires the user ID if there's a chance that the hash is an old-style hash.
$hash | String Password hash |
$password | String Plain-text password to compare |
$userId | String|bool User ID for old-style password salt |
Definition at line 3918 of file User.php.
References $result, oldCrypt(), and wfRunHooks().
Referenced by ExternalUser_MediaWiki\authenticate().
User::compareSecrets | ( | $ | answer, |
$ | test | ||
) | [protected] |
A comparison of two strings, not vulnerable to timing attacks.
string | $answer | the secret string that you are comparing against. |
string | $test | compare this string to the $answer. |
Definition at line 1019 of file User.php.
References $result, and $test.
Referenced by loadFromSession().
User::confirmationToken | ( | &$ | expiration | ) | [private] |
Generate, store, and return a new e-mail confirmation code.
A hash (unsalted, since it's used as a key) is stored.
&$expiration | Mixed : Accepts the expiration time |
Definition at line 3342 of file User.php.
References $wgUserEmailConfirmationTokenExpiry, MWCryptRand\generateHex(), load(), and wfTimestamp().
Referenced by sendConfirmationMail().
User::confirmationTokenUrl | ( | $ | token | ) | [private] |
Return a URL the user can use to confirm their email address.
$token | String Accepts the email confirmation token |
Definition at line 3360 of file User.php.
References getTokenUrl().
Referenced by sendConfirmationMail().
Mark the e-mail address confirmed.
Definition at line 3400 of file User.php.
References setEmailAuthenticationTimestamp(), wfRunHooks(), and wfTimestampNow().
static User::createNew | ( | $ | name, |
$ | params = array() |
||
) | [static] |
Add a user to the database, return the user object.
$name | String Username to add |
$params | Array of Strings Non-default parameters to save to the database as user_* fields:
|
Definition at line 2907 of file User.php.
References $user, newFromId(), and wfGetDB().
Referenced by ApiTestUser\__construct(), UserWrapper\__construct(), TitlePermissionTest\setUp(), and ParserTest\setupDatabase().
static User::crypt | ( | $ | password, |
$ | salt = false |
||
) | [static] |
Make a new-style password hash.
$password | String Plain-text password | |
bool | string | $salt | Optional salt, may be random or the user ID. |
If unspecified or false, will generate one automatically
Definition at line 3890 of file User.php.
References $wgPasswordSalt, MWCryptRand\generateHex(), and wfRunHooks().
Referenced by setInternalPassword(), and setNewpassword().
User::decodeOptions | ( | $ | str | ) | [private] |
Set this user's options from an encoded string.
$str | String Encoded options to import |
Definition at line 2717 of file User.php.
References getDefaultOptions(), and wfDeprecated().
Referenced by loadFromRow().
User::deleteNewtalk | ( | $ | field, |
$ | id | ||
) | [protected] |
Clear the new messages flag for the given user.
$field | String 'user_ip' for anonymous users, 'user_id' otherwise |
$id | String|Int User's IP address for anonymous users, User ID otherwise |
Definition at line 1856 of file User.php.
References wfDebug(), and wfGetDB().
Referenced by setNewtalk().
User::doLogout | ( | ) |
Clear the user's cookies and session, and reset the instance cache.
Definition at line 2821 of file User.php.
References clearCookie(), clearInstanceCache(), getRequest(), setCookie(), and wfTimestampNow().
Referenced by logout().
static User::edits | ( | $ | uid | ) | [static] |
Count the number of edits of a user.
$uid | Int User ID to check |
Definition at line 803 of file User.php.
References $count, $dbr, wfGetDB(), wfProfileIn(), and wfProfileOut().
Referenced by getEditCount(), and Linker\userToolLinks().
User::editToken | ( | $ | salt = '' , |
$ | request = null |
||
) |
Alias for getEditToken.
$salt | String|Array of Strings Optional function-specific data for hashing |
$request | WebRequest object to use or null to use $wgRequest |
Definition at line 3196 of file User.php.
References getEditToken(), and wfDeprecated().
static User::generateToken | ( | $ | salt = '' | ) | [static] |
Generate a looking random token for various uses.
$salt | String Optional salt value |
Definition at line 3239 of file User.php.
References MWCryptRand\generateHex().
static User::getAllGroups | ( | ) | [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 3607 of file User.php.
References $wgGroupPermissions, and $wgRevokePermissions.
Referenced by UsersPager\__construct(), changeableByGroup(), changeableGroups(), ApiQueryAllUsers\execute(), UsersPager\getAllGroups(), ApiUserrights\getAllowedParams(), and ApiQueryAllUsers\getAllowedParams().
static User::getAllRights | ( | ) | [static] |
Get a list of all available permissions.
Definition at line 3619 of file User.php.
References $mAllRights, $mCoreRights, $wgAvailableRights, and wfRunHooks().
Referenced by ApiQueryAllUsers\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
$recache | Bool Whether to avoid the cache |
Definition at line 2367 of file User.php.
References Autopromote\getAutopromoteGroups(), getId(), wfProfileIn(), and wfProfileOut().
Referenced by getEffectiveGroups().
User::getBlock | ( | $ | bFromSlave = true | ) |
Get the block affecting the user, or null if the user is not blocked.
$bFromSlave | Bool Whether to check the slave database instead of the master |
Definition at line 1576 of file User.php.
References getBlockedStatus().
Referenced by isBlocked().
User::getBlockedStatus | ( | $ | bFromSlave = true | ) | [private] |
Get blocking information.
$bFromSlave | Bool Whether to check the slave database first. To improve performance, non-critical checks are done against slaves. Check when actually saving should be done against master. |
Definition at line 1277 of file User.php.
References $wgProxyWhitelist, $wgUser, getName(), getRequest(), isAllowed(), isAnon(), isDnsBlacklisted(), load(), Block\newFromTarget(), Block\setBlocker(), wfDebug(), wfMsg(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by blockedBy(), blockedFor(), getBlock(), getBlockId(), isBlockedFromCreateAccount(), isBlockedFromEmailuser(), and isHidden().
User::getBlockId | ( | ) |
If user is blocked, return the ID for the block.
Definition at line 1629 of file User.php.
References false, and getBlockedStatus().
User::getBoolOption | ( | $ | oname | ) |
Get the user's current setting for a given option, as a boolean value.
$oname | String The option to check |
Definition at line 2234 of file User.php.
References getOption().
static User::getCanonicalName | ( | $ | name, |
$ | validate = 'valid' |
||
) | [static] |
Given unvalidated user input, return a canonical username, or false if the username is invalid.
$name | String User input |
$validate | String|Bool type of validation to use:
|
Definition at line 749 of file User.php.
References $t, $wgAuth, $wgContLang, isCreatableName(), isUsableName(), isValidUserName(), Title\makeTitle(), and Title\newFromText().
Referenced by RollbackEdits\execute(), UserrightsPage\execute(), ApiQueryUsers\execute(), UserrightsPage\fetchUser(), ApiRollback\getRbUser(), ExternalUser_MediaWiki\initFromName(), newFromName(), ApiQueryContributions\prepareUsername(), ApiQueryBlocks\prepareUsername(), and WebInstaller_Name\submit().
Get the user's preferred date format.
Definition at line 2284 of file User.php.
References $wgLang, and getOption().
Referenced by getPageRenderingHash(), and Language\internalUserTimeAndDate().
static User::getDefaultOption | ( | $ | opt | ) | [static] |
Get a given default option value.
$opt | String Name of option to retrieve |
Definition at line 1260 of file User.php.
References getDefaultOptions().
Referenced by Language\dateFormat(), CoreParserFunctions\gender(), GenderCache\getDefault(), getOption(), getOptions(), Linker\makeImageLink2(), and ImagePage\openShowImage().
static User::getDefaultOptions | ( | ) | [static] |
Combine the language default options with any site-specific options and add the default language variants.
Definition at line 1230 of file User.php.
References $wgContLang, $wgDefaultSkin, $wgDefaultUserOptions, $wgNamespacesToBeSearchedDefault, SearchEngine\searchableNamespaces(), and wfRunHooks().
Referenced by decodeOptions(), getDefaultOption(), userOptions\getDefaultOptionsNames(), getOption(), Preferences\getPreferences(), userOptions\LISTER(), loadOptions(), resetOptions(), and userOptions\USAGER().
Get the user's edit count.
Definition at line 2417 of file User.php.
References edits(), and getId().
Referenced by Autopromote\checkCondition(), loadFromDatabase(), and LogFormatter\makeUserLink().
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.
$salt | String|Array of Strings Optional function-specific data for hashing |
$request | WebRequest object to use or null to use $wgRequest |
Definition at line 3213 of file User.php.
References EDIT_TOKEN_SUFFIX, MWCryptRand\generateHex(), getRequest(), and isAnon().
Referenced by editToken(), WatchAction\getWatchToken(), matchEditToken(), and matchEditTokenNoSuffix().
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
$recache | Bool Whether to avoid the cache |
Definition at line 2346 of file User.php.
References getAutomaticGroups(), getGroups(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by addGroup(), changeableGroups(), getRights(), and removeGroup().
User::getEmail | ( | ) |
Get the user's e-mail address.
Definition at line 2114 of file User.php.
References load(), and wfRunHooks().
Referenced by Autopromote\checkCondition(), and Preferences\trySetUserEmail().
Get the timestamp of the user's e-mail authentication.
Definition at line 2124 of file User.php.
References load(), and wfRunHooks().
Referenced by Autopromote\checkCondition(), and isEmailConfirmed().
Get the timestamp of the first edit.
Definition at line 3518 of file User.php.
References $dbr, getId(), wfGetDB(), and wfTimestamp().
Referenced by Autopromote\checkCondition().
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
Definition at line 2398 of file User.php.
References $dbr, $res, and wfGetDB().
Referenced by Autopromote\getAutopromoteOnceGroups().
static User::getGroupMember | ( | $ | group, |
$ | username = '#' |
||
) | [static] |
Get the localized descriptive name for a member of a group, if it exists.
$group | String Internal group name |
$username | String Username for gender (since 1.19) |
Definition at line 3596 of file User.php.
References wfMessage().
Referenced by UsersPager\buildGroupLink(), UserrightsPage\groupCheckboxes(), and Preferences\profilePreferences().
static User::getGroupName | ( | $ | group | ) | [static] |
Get the localized descriptive name for a group, if it exists.
$group | String Internal group name |
Definition at line 3584 of file User.php.
References wfMessage().
Referenced by UserrightsPage\buildGroupLink(), UsersPager\getAllGroups(), makeGroupLinkHTML(), makeGroupLinkWiki(), and Preferences\profilePreferences().
static User::getGroupPage | ( | $ | group | ) | [static] |
Get the title of a page describing a particular group.
$group | String Internal group name |
Definition at line 3649 of file User.php.
References $title, Title\newFromText(), and wfMessage().
Referenced by makeGroupLinkHTML(), and makeGroupLinkWiki().
static User::getGroupPermissions | ( | $ | groups | ) | [static] |
Get the permissions associated with a given list of groups.
$groups | Array of Strings List of internal group names |
Definition at line 3540 of file User.php.
References $wgGroupPermissions, and $wgRevokePermissions.
Referenced by addGroup(), Autopromote\checkCondition(), ApiMain\checkExecutePermissions(), ApiQueryAllUsers\execute(), ApiQueryUsers\execute(), getRights(), AjaxDispatcher\performAction(), removeGroup(), ApiMain\setCacheMode(), UserTest\testGroupPermissions(), UserTest\testRevokePermissions(), and wfStreamThumb().
User::getGroups | ( | ) |
Get the list of explicit group memberships this user has.
The implicit * and user groups are not included.
Definition at line 2333 of file User.php.
References load(), and loadGroups().
Referenced by addAutopromoteOnceGroups(), Autopromote\checkCondition(), Autopromote\getAutopromoteOnceGroups(), getEffectiveGroups(), and pingLimiter().
static User::getGroupsWithPermission | ( | $ | role | ) | [static] |
Get all the groups who have a given permission.
$role | String Role to check |
Definition at line 3567 of file User.php.
References $wgGroupPermissions.
Referenced by PermissionsError\__construct(), ApiQueryAllUsers\execute(), NewFilesPager\getQueryInfo(), Title\missingPermissionError(), ApiMain\reallyMakeHelpMsg(), and UserTest\testGetGroupsWithPermission().
User::getId | ( | ) |
Get the user's ID.
Definition at line 1695 of file User.php.
References isIP(), isItemLoaded(), and load().
Referenced by addAutopromoteOnceGroups(), addGroup(), addNewUserLogEntry(), addNewUserLogEntryAutoCreate(), checkTemporaryPassword(), SpecialBlock\checkUnblockSelf(), clearAllNotifications(), WikiPage\doUpdateRestrictions(), ApiBlock\execute(), getAutomaticGroups(), getEditCount(), getFirstEditTimestamp(), SpecialEmailUser\getTarget(), SpecialContributions\getUserLinks(), incEditCount(), loadOptions(), LogFormatter\makeUserLink(), pingLimiter(), saveOptions(), and setNewtalk().
static User::getImplicitGroups | ( | ) | [static] |
Get a list of implicit groups.
Definition at line 3636 of file User.php.
References $wgImplicitGroups, and wfRunHooks().
Referenced by UsersPager\getGroups().
User::getIntOption | ( | $ | oname, |
$ | defaultOverride = 0 |
||
) |
Get the user's current setting for a given option, as a boolean value.
$oname | String The option to check |
$defaultOverride | Int A default value returned if the option does not exist |
Definition at line 2246 of file User.php.
References getOption().
User::getName | ( | ) |
Get the user name, or the IP of an anonymous user.
Definition at line 1720 of file User.php.
References getRequest(), isItemLoaded(), load(), and IP\sanitizeIP().
Referenced by __toString(), addNewUserLogEntry(), SpecialChangeEmail\attemptChange(), SpecialBlock\checkUnblockSelf(), clearNotification(), RecentChange\doMarkPatrolled(), ApiUnblock\execute(), getBlockedStatus(), getNewtalk(), getPasswordValidity(), getTitleKey(), SpecialContributions\getUserLinks(), getUserPage(), idForName(), isBlockedFrom(), isBlockedGlobally(), CreditsAction\link(), LogFormatter\makeUserLink(), RdfMetaData\person(), pingLimiter(), sendConfirmationMail(), setCookies(), setNewtalk(), spreadBlock(), and CreditsAction\userLink().
Return the talk page(s) this user has new messages on.
Definition at line 1797 of file User.php.
References getNewtalk(), getUserPage(), wfRunHooks(), and wfWikiID().
User::getNewtalk | ( | ) |
Check if the user has new messages.
Definition at line 1764 of file User.php.
References $wgMemc, checkNewtalk(), getName(), load(), and wfMemcKey().
Referenced by getNewMessageLinks().
User::getOption | ( | $ | oname, |
$ | defaultOverride = null , |
||
$ | ignoreHidden = false |
||
) |
Get the user's current setting for a given option.
$oname | String The option to check |
$defaultOverride | String A default value returned if the option does not exist |
$ignoreHidden | Bool = whether to ignore the effects of $wgHiddenPrefs |
Reimplemented in PPFuzzUser.
Definition at line 2175 of file User.php.
References $wgHiddenPrefs, getDefaultOption(), getDefaultOptions(), and loadOptions().
Referenced by canReceiveEmail(), getBoolOption(), getDatePreference(), getIntOption(), getPageRenderingHash(), getStubThreshold(), Language\internalUserTimeAndDate(), and setCookies().
User::getOptions | ( | ) |
Get all user's options.
Definition at line 2207 of file User.php.
References $options, $wgHiddenPrefs, getDefaultOption(), and loadOptions().
Generate a string which will be different for any combination of user options which would produce different parser output.
This will be used as part of the hash key for the parser cache, so users with the same options can share the same cached data safely.
Extensions which require it should install 'PageRenderingHash' hook, which will give them a chance to modify this key based on their own settings.
Definition at line 3018 of file User.php.
References $wgContLang, $wgLang, $wgRenderHashAppend, $wgUseDynamicDates, getDatePreference(), getOption(), getStubThreshold(), wfDeprecated(), and wfRunHooks().
User::getPasswordValidity | ( | $ | password | ) |
Given unvalidated password input, return error message on failure.
$password | String Desired password |
Definition at line 671 of file User.php.
References $result, $wgContLang, $wgMinimalPasswordLength, getName(), and wfRunHooks().
Referenced by isValidPassword(), and setPassword().
Get the user's real name.
Definition at line 2148 of file User.php.
References isItemLoaded(), and load().
Referenced by CreditsAction\link(), RdfMetaData\person(), and CreditsAction\userLink().
Get the timestamp of account creation.
Definition at line 3504 of file User.php.
References isAnon(), and load().
Referenced by Autopromote\checkCondition().
User::getRequest | ( | ) |
Get the WebRequest object to use with this object.
Definition at line 2577 of file User.php.
Referenced by Autopromote\checkCondition(), doLogout(), getBlockedStatus(), getEditToken(), getName(), isBlockedFromCreateAccount(), isBlockedGlobally(), isPingLimitable(), loadDefaults(), loadFromSession(), pingLimiter(), sendConfirmationMail(), setCookie(), setCookies(), and spreadBlock().
static User::getRightDescription | ( | $ | right | ) | [static] |
Get the description of a given right.
$right | String Right to query |
Definition at line 3859 of file User.php.
References wfMessage().
Referenced by SpecialListGroupRights\formatPermissions().
User::getRights | ( | ) |
Get the permissions this user has.
Definition at line 2318 of file User.php.
References getEffectiveGroups(), getGroupPermissions(), and wfRunHooks().
Referenced by isAllowed().
User::getSkin | ( | ) |
Get the current skin, loading it if required.
Definition at line 2592 of file User.php.
References RequestContext\getMain(), and wfDeprecated().
Get the user preferred stub threshold.
Definition at line 2303 of file User.php.
References $wgMaxArticleSize, and getOption().
Referenced by getPageRenderingHash().
Get the user's name escaped by underscores.
Definition at line 1756 of file User.php.
References getName().
Referenced by WikiPage\doEditUpdates().
User::getToken | ( | $ | forceCreation = true | ) |
Get the user's current token.
$forceCreation | Force the generation of a new token if the user doesn't have one (default=true for backwards compatibility) |
Definition at line 2047 of file User.php.
References load(), and setToken().
User::getTokenUrl | ( | $ | page, |
$ | token | ||
) | [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.
$page | String Special page |
$token | String Token |
Definition at line 3387 of file User.php.
References $title, and Title\makeTitle().
Referenced by confirmationTokenUrl(), and invalidationTokenUrl().
User::getTouched | ( | ) |
Get this user's personal page title.
Definition at line 3100 of file User.php.
References getName(), and Title\makeTitle().
Referenced by addAutopromoteOnceGroups(), addNewUserLogEntry(), addNewUserLogEntryAutoCreate(), getNewMessageLinks(), getTalkPage(), CreditsAction\link(), RdfMetaData\person(), and saveSettings().
User::idForName | ( | ) |
static User::idFromName | ( | $ | name | ) | [static] |
Get database id given a user name.
$name | String Username |
Definition at line 471 of file User.php.
References $dbr, $result, Title\makeTitleSafe(), and wfGetDB().
Referenced by LegacyTemplate\bottomLinks(), ApiQueryLogEvents\execute(), UsersPager\getQueryInfo(), LogPage\getTitleLink(), ContribsPager\getUserCond(), WikiRevision\importLogItem(), LogPager\limitPerformer(), load(), SpecialUnblock\processUnblock(), StandardTemplate\quickBar(), CologneBlueTemplate\quickBar(), and BlockTest\testBug29116LoadWithEmptyIp().
User::inDnsBlacklist | ( | $ | ip, |
$ | bases | ||
) |
Whether the given IP is in a given DNS blacklist.
$ip | String IP to check |
$bases | String|Array of Strings: URL of the DNS blacklist |
Definition at line 1371 of file User.php.
References IP\isIPv4(), wfDebug(), wfProfileIn(), and wfProfileOut().
Referenced by isDnsBlacklisted().
Immediately touch the user data cache for this account.
Updates user_touched field, and removes account data from memcached for reload on the next hit.
Definition at line 1938 of file User.php.
References clearSharedCache(), load(), newTouchedTimestamp(), wfGetDB(), and wfReadOnly().
Referenced by addGroup(), addWatch(), incEditCount(), removeGroup(), removeWatch(), and setNewtalk().
Invalidate the user's e-mail confirmation, and unauthenticate the e-mail address if it was already confirmed.
Definition at line 3413 of file User.php.
References load(), setEmailAuthenticationTimestamp(), and wfRunHooks().
Referenced by setEmail().
User::invalidationTokenUrl | ( | $ | token | ) | [private] |
Return a URL the user can use to invalidate their email address.
$token | String Accepts the email confirmation token |
Definition at line 3369 of file User.php.
References getTokenUrl().
Referenced by sendConfirmationMail().
User::isAllowed | ( | $ | action = '' | ) |
Internal mechanics of testing a permission.
$action | String |
Definition at line 2539 of file User.php.
References $wgUseNPPatrol, $wgUseRCPatrol, and getRights().
Referenced by canSendEmail(), changeableGroups(), SpecialBlock\checkUnblockSelf(), WikiPage\commitRollback(), WikiPage\doEditUpdates(), RecentChange\doMarkPatrolled(), WikiPage\doViewUpdates(), getBlockedStatus(), isAllowedAll(), isAllowedAny(), isAllowedToCreateAccount(), Title\isNamespaceProtected(), isNewbie(), isPingLimitable(), and SpecialPage\userCanExecute().
Definition at line 2524 of file User.php.
References isAllowed().
Check if user is allowed to access a feature / make an action.
Definition at line 2509 of file User.php.
References isAllowed().
Referenced by WikiPage\commitRollback(), useNPPatrol(), and useRCPatrol().
Get whether the user is allowed to create an account.
Definition at line 3091 of file User.php.
References isAllowed(), and isBlockedFromCreateAccount().
User::isAnon | ( | ) |
Get whether the user is anonymous.
Definition at line 2497 of file User.php.
References isLoggedIn().
Referenced by WatchAction\checkCanExecute(), clearNotification(), getBlockedStatus(), getEditToken(), getRegistration(), incEditCount(), isEmailConfirmed(), CreditsAction\link(), RdfMetaData\person(), saveToCache(), setNewtalk(), and CreditsAction\userLink().
User::isBlocked | ( | $ | bFromSlave = true | ) |
Check if user is blocked.
$bFromSlave | Bool Whether to check the slave database instead of the master |
Definition at line 1566 of file User.php.
References getBlock().
Referenced by SpecialPasswordReset\canChangePassword(), Action\checkCanExecute(), Autopromote\checkCondition(), FormSpecialPage\checkExecutePermissions(), SpecialBlock\checkUnblockSelf(), SpecialContributions\getUserLinks(), isBlockedFrom(), and spreadAnyEditBlock().
User::isBlockedFrom | ( | $ | title, |
$ | bFromSlave = false |
||
) |
Check if user is blocked from editing a particular article.
$title | Title to check |
$bFromSlave | Bool whether to check the slave database instead of the master |
Definition at line 1588 of file User.php.
References $title, $wgBlockAllowsUTEdit, false, getName(), isBlocked(), wfDebug(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Get whether the user is explicitly blocked from account creation.
Definition at line 3061 of file User.php.
References getBlockedStatus(), getRequest(), Block\newFromTarget(), and Block\prevents().
Referenced by isAllowedToCreateAccount().
Get whether the user is blocked from using Special:Emailuser.
Definition at line 3082 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 intented for quick UI checks.
$ip | String IP address, uses current client if none given |
Definition at line 1642 of file User.php.
References getName(), getRequest(), IP\isIPAddress(), and wfRunHooks().
static User::isCreatableName | ( | $ | name | ) | [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.
$name | String to match |
Definition at line 630 of file User.php.
References $wgInvalidUsernameCharacters, isUsableName(), and wfDebugLog().
Referenced by getCanonicalName().
User::isDnsBlacklisted | ( | $ | ip, |
$ | checkWhitelist = false |
||
) |
Whether the given IP is in a DNS blacklist.
$ip | String IP to check |
$checkWhitelist | Bool: whether to check the whitelist first |
Definition at line 1350 of file User.php.
References $urls, $wgDnsBlacklistUrls, $wgEnableDnsBlacklist, $wgEnableSorbs, $wgProxyWhitelist, $wgSorbsUrl, and inDnsBlacklist().
Referenced by getBlockedStatus().
Check whether there is an outstanding request for e-mail confirmation.
Definition at line 3490 of file User.php.
References $wgEmailAuthentication, isEmailConfirmed(), and wfTimestamp().
Is this user's e-mail address valid-looking and confirmed within limits of the current site configuration?
Definition at line 3466 of file User.php.
References $wgEmailAuthentication, getEmailAuthenticationTimestamp(), isAnon(), load(), Sanitizer\validateEmail(), and wfRunHooks().
Referenced by canReceiveEmail(), canSendEmail(), and isEmailConfirmationPending().
User::isHidden | ( | ) |
Check if user account is hidden.
Definition at line 1678 of file User.php.
References $wgAuth, and getBlockedStatus().
static User::isIP | ( | $ | name | ) | [static] |
Does the string match an anonymous IPv4 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 {1,3}\.{1,3}\.{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.
$name | String to match |
Definition at line 523 of file User.php.
References IP\isIPv6().
Referenced by LegacyTemplate\bottomLinks(), WikiPage\doEditUpdates(), RollbackEdits\execute(), getId(), SearchEngine\getNearMatchInternal(), ApiRollback\getRbUser(), Skin\getRelevantUser(), ReassignEdits\initialiseUser(), isValidUserName(), ApiQueryContributions\prepareUsername(), ApiQueryBlocks\prepareUsername(), StandardTemplate\quickBar(), EditPage\showIntro(), and Article\showMissingArticle().
User::isItemLoaded | ( | $ | item, |
$ | all = 'all' |
||
) |
Return whether an item has been loaded.
$item | String: item to check. Current possibilities:
|
$all | String: '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 901 of file User.php.
Referenced by getId(), getName(), and getRealName().
static User::isLocallyBlockedProxy | ( | $ | ip | ) | [static] |
Check if an IP address is in the local proxy list.
$ip | string |
Definition at line 1418 of file User.php.
References $wgProxyList, wfProfileIn(), and wfProfileOut().
User::isLocked | ( | ) |
User::isLoggedIn | ( | ) |
Get whether the user is logged in.
Definition at line 2489 of file User.php.
Referenced by isAnon(), and spreadAnyEditBlock().
User::isNewbie | ( | ) |
Determine whether the user is a newbie.
Newbies are either anonymous IPs, or the most recently created accounts.
Definition at line 3119 of file User.php.
References isAllowed().
Referenced by pingLimiter().
Has password reminder email been sent within the last $wgPasswordReminderResendTime hours?
Definition at line 2100 of file User.php.
References $wgPasswordReminderResendTime, load(), and wfTimestamp().
Is this user subject to rate limiting?
Definition at line 1450 of file User.php.
References $wgRateLimitsExcludedIPs, getRequest(), and isAllowed().
Referenced by pingLimiter().
static User::isUsableName | ( | $ | name | ) | [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.
$name | String to match |
Definition at line 593 of file User.php.
References $wgReservedUsernames, wfMsgForContent(), and wfRunHooks().
Referenced by LoginForm\authenticateUserData(), getCanonicalName(), and isCreatableName().
static User::isValidEmailAddr | ( | $ | addr | ) | [static] |
Does a string look like an e-mail address?
This validates an email address using an HTML5 specification found at: http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address Which as of 2011-01-24 says:
A valid e-mail address is a string that matches the ABNF production 1*( atext / "." ) "@" ldh-str *( "." ldh-str ) where atext is defined in RFC 5322 section 3.2.3, and ldh-str is defined in RFC 1034 section 3.5.
This function is an implementation of the specification as requested in bug 22449.
Client-side forms will use the same standard validation rules via JS or HTML 5 validation; additional restrictions can be enforced server-side by extensions via the 'isValidEmailAddr' hook.
Note that this validation doesn't 100% match RFC 2822, but is believed to be liberal enough for wide use. Some invalid addresses will still pass validation here.
$addr | String E-mail address |
Definition at line 732 of file User.php.
References Sanitizer\validateEmail(), and wfDeprecated().
User::isValidPassword | ( | $ | password | ) |
Is the input a valid password for this user?
$password | String Desired password |
Definition at line 660 of file User.php.
References getPasswordValidity().
Referenced by checkPassword(), and setPassword().
static User::isValidUserName | ( | $ | name | ) | [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 containins slashes (would mess up subpages), is longer than the maximum allowed username size or doesn't begin with a capital letter.
$name | String to match |
Definition at line 538 of file User.php.
References $wgContLang, $wgMaxNameChars, isIP(), Title\newFromText(), and wfDebugLog().
Referenced by CheckUsernames\execute(), getCanonicalName(), and GenderCache\getGenderOf().
User::isWatched | ( | $ | title | ) |
Check the watched status of an article.
$title | Title of the article to look at |
Definition at line 2602 of file User.php.
References $title, and WatchedItem\fromUserTitle().
Referenced by clearNotification().
User::load | ( | ) |
Load the user table data for this object from the source given by mFrom.
Reimplemented in PPFuzzUser.
Definition at line 243 of file User.php.
References idFromName(), loadDefaults(), loadFromId(), loadFromSession(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by addToDatabase(), checkPassword(), checkTemporaryPassword(), clearSharedCache(), confirmationToken(), getBlockedStatus(), getEmail(), getEmailAuthenticationTimestamp(), getGroups(), getId(), getName(), getNewtalk(), getRealName(), getRegistration(), getToken(), getTouched(), invalidateCache(), invalidateEmail(), isEmailConfirmed(), isPasswordReminderThrottled(), loadOptions(), removeGroup(), saveSettings(), saveToCache(), setCookiePassword(), setCookies(), setEmail(), setEmailAuthenticationTimestamp(), setInternalPassword(), setName(), setNewpassword(), setNewtalk(), setOption(), setRealName(), setToken(), spreadBlock(), LanguageConverterTest\testGetPreferredVariantUserOption(), and validateCache().
User::loadDefaults | ( | $ | name = false | ) |
Set cached properties to default.
$name | string |
Definition at line 858 of file User.php.
References getRequest(), wfProfileIn(), wfProfileOut(), wfRunHooks(), and wfTimestamp().
Referenced by PPFuzzUser\load(), load(), loadFromDatabase(), loadFromId(), and loadFromSession().
Load user and user_group data from the database.
$this->mId must be set, this is how the user is identified.
Definition at line 1038 of file User.php.
References $dbr, getEditCount(), loadDefaults(), loadFromRow(), wfGetDB(), and wfRunHooks().
Referenced by loadFromId().
User::loadFromId | ( | ) |
Load user table data, given mId has already been set.
Definition at line 282 of file User.php.
References $wgMemc, loadDefaults(), loadFromDatabase(), saveToCache(), wfDebug(), and wfMemcKey().
Referenced by load().
User::loadFromRow | ( | $ | row | ) |
Initialize this object from a row from the user table.
$row | Array Row from the user table to load. |
Definition at line 1072 of file User.php.
References decodeOptions(), setItemLoaded(), wfTimestamp(), and wfTimestampOrNull().
Referenced by loadFromDatabase().
User::loadFromSession | ( | ) | [private] |
Load user data from the session or login cookie.
If there are no valid credentials, initialises the user as an anonymous user.
Definition at line 922 of file User.php.
References $result, $wgAutocreatePolicy, $wgBlockDisablesLogin, $wgExternalAuthType, compareSecrets(), getRequest(), loadDefaults(), loadFromUserObject(), ExternalUser\newFromCookie(), newFromId(), wfDebug(), wfDebugLog(), and wfRunHooks().
Referenced by load().
User::loadFromUserObject | ( | $ | user | ) | [protected] |
Load the data for this user object from another user object.
$user | User |
Definition at line 1137 of file User.php.
References $user.
Referenced by loadFromSession().
User::loadGroups | ( | ) | [private] |
Load the groups from the database if they aren't already loaded.
Definition at line 1149 of file User.php.
References $dbr, $res, and wfGetDB().
Referenced by addGroup(), getGroups(), removeGroup(), and saveToCache().
User::loadOptions | ( | ) | [protected] |
Definition at line 3994 of file User.php.
References $dbr, $res, getDefaultOptions(), getId(), load(), wfDebug(), wfGetDB(), and wfRunHooks().
Referenced by getOption(), getOptions(), saveOptions(), saveToCache(), and setOption().
User::logout | ( | ) |
Log this user out.
Definition at line 2811 of file User.php.
References doLogout(), and wfRunHooks().
static User::makeGroupLinkHTML | ( | $ | group, |
$ | text = '' |
||
) | [static] |
Create a link to the group in HTML, if available; else return the group name.
$group | String Internal name of the group |
$text | String The text of the link |
Definition at line 3667 of file User.php.
References $title, getGroupName(), getGroupPage(), and Linker\link().
Referenced by Preferences\profilePreferences().
static User::makeGroupLinkWiki | ( | $ | group, |
$ | text = '' |
||
) | [static] |
Create a link to the group in Wikitext, if available; else return the group name.
$group | String Internal name of the group |
$text | String The text of the link |
Definition at line 3687 of file User.php.
References $page, $title, getGroupName(), and getGroupPage().
User::matchEditToken | ( | $ | val, |
$ | salt = '' , |
||
$ | request = 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.
$val | String Input value to compare |
$salt | String Optional function-specific data for hashing |
$request | WebRequest object to use or null to use $wgRequest |
Definition at line 3254 of file User.php.
References getEditToken(), and wfDebug().
Referenced by WikiPage\doRollback().
User::matchEditTokenNoSuffix | ( | $ | val, |
$ | salt = '' , |
||
$ | request = null |
||
) |
Check given value against the token value stored in the session, ignoring the suffix.
$val | String Input value to compare |
$salt | String Optional function-specific data for hashing |
$request | WebRequest object to use or null to use $wgRequest |
Definition at line 3271 of file User.php.
References getEditToken().
static User::newFromConfirmationCode | ( | $ | code | ) | [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.
$code | String Confirmation code |
Definition at line 396 of file User.php.
References $dbr, newFromId(), and wfGetDB().
Referenced by EmailConfirmation\attemptConfirm(), and EmailInvalidation\attemptInvalidate().
static User::newFromId | ( | $ | id | ) | [static] |
Static factory method for creation from a given user ID.
$id | Int Valid user ID |
Definition at line 378 of file User.php.
References setItemLoaded().
Referenced by Installer\__construct(), NewParserTest\addDBData(), LogPage\addEntry(), RdfMetaData\basics(), userOptions\CHANGER(), SpecialBlock\checkUnblockSelf(), createNew(), RemoveUnusedAccounts\execute(), ResetUserTokens\execute(), ChangePassword\execute(), NewFilesPager\formatRow(), UsersPager\getGroups(), NewUsersLogFormatter\getMessageParameters(), DatabaseLogEntry\getPerformer(), RCDatabaseLogEntry\getPerformer(), DeletedContributionsPage\getSubTitle(), loadFromSession(), newFromConfirmationCode(), SpecialSearchTest\newUserWithSearchNS(), EnotifNotifyJob\run(), TitlePermissionTest\setUp(), Skin\showEmailUser(), LanguageConverterTest\testGetPreferredVariantHeaderUserVsUrl(), and userOptions\USAGER().
static User::newFromName | ( | $ | name, |
$ | validate = 'valid' |
||
) | [static] |
Static factory method for creation from username.
This is slightly less efficient than newFromId(), so use newFromId() if you have both an ID and a name handy.
$name | String Username, validated by Title::newFromText() |
$validate | String|Bool Validate username. Takes the same parameters as User::getCanonicalName(), except that true is accepted as an alias for 'valid', for BC. |
Definition at line 355 of file User.php.
References getCanonicalName(), and setItemLoaded().
Referenced by ApiTestUser\__construct(), UserWrapper\__construct(), EmailNotification\actuallyNotifyOnPageChange(), MediaWikiTestCase\addCoreDBData(), ApiBlockTest\addDBData(), BlockTest\addDBData(), LoginForm\addNewAccountInternal(), SpecialChangePassword\attemptReset(), LoginForm\authenticateUserData(), EmailNotification\canSendUserTalkEmail(), SpecialBlock\checkUnblockSelf(), Installer\createMainpage(), Installer\createSysop(), WikiPage\doEditUpdates(), ImportSiteScripts\execute(), DeleteDefaultMessages\execute(), CleanupSpam\execute(), SpecialBlockme\execute(), Undelete\execute(), RollbackEdits\execute(), ApiQueryAllUsers\execute(), Protect\execute(), ChangePassword\execute(), CreateAndPromote\execute(), EditCLI\execute(), SpecialContributions\execute(), CapsCleanup\execute(), TableCleanup\execute(), DeleteBatch\execute(), MoveBatch\execute(), SpecialLog\execute(), DeletedContributionsPage\execute(), UserrightsPage\fetchUser(), CoreParserFunctions\gender(), CreditsAction\getAuthor(), LogEventsList\getExtraInputs(), NewUsersLogFormatter\getMessageParameters(), ResourceLoaderUserGroupsModule\getPages(), DatabaseLogEntry\getPerformer(), RCDatabaseLogEntry\getPerformer(), Skin\getRelevantUser(), SpecialEmailUser\getTarget(), DoubleRedirectJob\getUser(), ApiBase\getWatchlistUser(), WikiRevision\importOldRevision(), WikiRevision\importUpload(), ReassignEdits\initialiseUser(), SearchEngineTest\insertPage(), RequestContext\newExtraneousContext(), WikiPage\onArticleDelete(), SpecialPasswordReset\onSubmit(), Block\parseTarget(), PatrolLog\record(), EnotifNotifyJob\run(), UploadFromUrlJob\run(), RecentChange\save(), TitlePermissionTest\setUp(), SpecialLog\show(), EditPage\showIntro(), Article\showMissingArticle(), WebInstaller_Name\submit(), ApiBlockTest\testMakeNormalBlock(), and PageArchive\undeleteRevisions().
static User::newFromRow | ( | $ | row | ) | [static] |
Create a new user object from a user row.
The row should have the following fields from the user table in it:
$row | Array A row from the user table |
Definition at line 437 of file User.php.
References $user.
Referenced by ConvertUserOptions\convertOptionBatch(), ApiQueryUsers\execute(), SpecialPasswordReset\onSubmit(), and UserArrayFromResult\setCurrent().
static User::newFromSession | ( | WebRequest $ | request = null | ) | [static] |
Create a new user object using data from session or cookies.
If the login credentials are invalid, the result is an anonymous user.
$request | WebRequest object to use; $wgRequest will be used if ommited. |
Definition at line 417 of file User.php.
References $user.
Referenced by RequestContext\getUser().
static User::newTouchedTimestamp | ( | ) | [static, private] |
Generate a current or new-future timestamp to be stored in the user_touched field when we update things.
Definition at line 1913 of file User.php.
References $wgClockSkewFudge, and wfTimestamp().
Referenced by invalidateCache(), and saveSettings().
static User::oldCrypt | ( | $ | password, |
$ | userId | ||
) | [static] |
Make an old-style password hash.
$password | String Plain-text password |
$userId | String User ID |
Definition at line 3872 of file User.php.
References $wgPasswordSalt.
Referenced by comparePasswords().
static User::passwordChangeInputAttribs | ( | ) | [static] |
Provide an array of HTML5 attributes to put on an input element intended for the user to enter a new password.
This may include required, title, and/or pattern, depending on $wgMinimalPasswordLength.
Do *not* use this when asking the user to enter his current password! Regardless of configuration, users may have invalid passwords for whatever reason (e.g., they were set before requirements were tightened up). Only use it when asking for a new password, like on account creation or ResetPass.
Obviously, you still need to do server-side checking.
NOTE: A combination of bugs in various browsers means that this function actually just returns array() unconditionally at the moment. May as well keep it around for when the browser bugs get fixed, though.
Definition at line 4103 of file User.php.
References $wgMinimalPasswordLength.
Referenced by UsercreateTemplate\execute(), and SpecialChangePassword\pretty().
User::pingLimiter | ( | $ | action = 'edit' | ) |
Primitive rate limits: enforce maximum actions per time period to put a brake on flooding.
$action | String Action to enforce; 'edit' if unspecified |
Definition at line 1471 of file User.php.
References $count, $keys, $limit, $matches, $result, $wgMemc, $wgRateLimitLog, $wgRateLimits, getGroups(), getId(), getName(), getRequest(), isNewbie(), isPingLimitable(), wfDebug(), wfMemcKey(), wfProfileIn(), wfProfileOut(), wfRestoreWarnings(), wfRunHooks(), wfSuppressWarnings(), wfTimestamp(), and wfWikiID().
Referenced by WikiPage\doRollback().
static User::randomPassword | ( | ) | [static] |
Return a random password.
Definition at line 838 of file User.php.
References $wgMinimalPasswordLength, MWCryptRand\generateHex(), and wfBaseConvert().
Referenced by ApiTestUser\__construct().
User::removeGroup | ( | $ | group | ) |
Remove the user from the given group.
This takes immediate effect.
$group | String Name of the group to remove |
Definition at line 2460 of file User.php.
References getEffectiveGroups(), getGroupPermissions(), invalidateCache(), load(), loadGroups(), wfGetDB(), and wfRunHooks().
User::removeWatch | ( | $ | title | ) |
Stop watching an article.
$title | Title of the article to look at |
Definition at line 2621 of file User.php.
References $title, WatchedItem\fromUserTitle(), and invalidateCache().
Referenced by WatchAction\doUnwatch().
static User::resetIdByNameCache | ( | ) | [static] |
Reset the cache used in idFromName().
For use in tests.
Definition at line 503 of file User.php.
Referenced by MediaWikiTestCase\addCoreDBData().
Reset all options to the site defaults.
Definition at line 2276 of file User.php.
References getDefaultOptions().
User::saveOptions | ( | ) | [protected] |
Definition at line 4034 of file User.php.
References $wgAllowPrefChange, getId(), loadOptions(), ExternalUser\newFromUser(), wfGetDB(), and wfRunHooks().
Referenced by addToDatabase(), and saveSettings().
Save this user's settings into the database.
Definition at line 2837 of file User.php.
References $wgAuth, clearSharedCache(), getUserPage(), load(), newTouchedTimestamp(), saveOptions(), wfGetDB(), wfReadOnly(), and wfRunHooks().
Referenced by SpecialChangeEmail\attemptChange(), sendConfirmationMail(), and setCookies().
Save user data to the shared cache.
Definition at line 318 of file User.php.
References $wgMemc, isAnon(), load(), loadGroups(), loadOptions(), MW_USER_VERSION, and wfMemcKey().
Referenced by loadFromId().
User::sendConfirmationMail | ( | $ | type = 'created' | ) |
Generate a new e-mail confirmation token and send a confirmation/invalidation mail to the user's given address.
$type | String: message to send, either "created", "changed" or "set" |
Definition at line 3283 of file User.php.
References $url, $wgLang, confirmationToken(), confirmationTokenUrl(), getName(), getRequest(), invalidationTokenUrl(), saveSettings(), sendMail(), and wfMsg().
Referenced by Preferences\trySetUserEmail().
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.
$subject | String Message subject |
$body | String Message body |
$from | String Optional From address; if unspecified, default $wgPasswordSender will be used |
$replyto | String Reply-To address |
Definition at line 3320 of file User.php.
References $wgPasswordSender, $wgPasswordSenderName, and UserMailer\send().
Referenced by sendConfirmationMail().
User::setCookie | ( | $ | name, |
$ | value, | ||
$ | exp = 0 |
||
) | [protected] |
Set a cookie on the user's client.
Wrapper for WebResponse::setCookie
$name | String Name of the cookie to set |
$value | String Value to set |
$exp | Int Expiration time, as a UNIX time value; if 0 or not specified, use the default $wgCookieExpiration |
Definition at line 2746 of file User.php.
References getRequest().
Referenced by clearCookie(), doLogout(), and setCookies().
User::setCookiePassword | ( | $ | str | ) | [private] |
User::setCookies | ( | $ | request = null | ) |
Set the default cookies for this session on the user's client.
$request | WebRequest object to use; $wgRequest will be used if null is passed. |
Definition at line 2764 of file User.php.
References clearCookie(), getName(), getOption(), getRequest(), load(), saveSettings(), setCookie(), setToken(), and wfRunHooks().
User::setEmail | ( | $ | str | ) |
Set the user's e-mail address.
$str | String New e-mail address |
Definition at line 2134 of file User.php.
References invalidateEmail(), load(), and wfRunHooks().
Referenced by Preferences\trySetUserEmail().
User::setEmailAuthenticationTimestamp | ( | $ | timestamp | ) |
Set the e-mail authentication timestamp.
$timestamp | String TS_MW timestamp |
Definition at line 3426 of file User.php.
References load(), and wfRunHooks().
Referenced by confirmEmail(), and invalidateEmail().
User::setId | ( | $ | v | ) |
Set the user and reload all fields according to a given ID.
$v | Int User ID to reload |
Definition at line 1711 of file User.php.
References clearInstanceCache().
User::setInternalPassword | ( | $ | str | ) |
Set the password and reset the random token unconditionally.
$str | String New password to set |
Definition at line 2028 of file User.php.
References crypt(), load(), and setToken().
Referenced by setPassword().
User::setItemLoaded | ( | $ | item | ) | [private] |
Set that an item has been loaded.
$item | String |
Definition at line 911 of file User.php.
Referenced by loadFromRow(), newFromId(), and newFromName().
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.
$str | String New user name to set |
Definition at line 1747 of file User.php.
References load().
User::setNewpassword | ( | $ | str, |
$ | throttle = true |
||
) |
Set the password for a password reminder or new account email.
$str | String New password to set |
$throttle | Bool If true, reset the throttle timestamp to the present |
Definition at line 2087 of file User.php.
References crypt(), load(), and wfTimestampNow().
User::setNewtalk | ( | $ | val | ) |
Update the 'You have new messages!' status.
$val | Bool Whether the user has new messages |
Definition at line 1874 of file User.php.
References $changed, $wgMemc, deleteNewtalk(), getId(), getName(), invalidateCache(), isAnon(), load(), updateNewtalk(), wfMemcKey(), and wfReadOnly().
Referenced by clearAllNotifications(), clearNotification(), and WikiPage\onArticleDelete().
User::setOption | ( | $ | oname, |
$ | val | ||
) |
Set the given option for a user.
$oname | String The option to set |
$val | mixed New value to set |
Definition at line 2260 of file User.php.
References $wgDefaultUserOptions, load(), and loadOptions().
User::setPassword | ( | $ | str | ) |
Set the password and reset the random token.
Calls through to authentication plugin if necessary; will have no effect if the auth plugin refuses to pass the change through or if the legal password checks fail.
As a special case, setting the password to null wipes it, so the account cannot be logged in until a new password is set, for instance via e-mail.
$str | String New password to set |
PasswordError | on failure |
Definition at line 1992 of file User.php.
References $wgAuth, $wgMinimalPasswordLength, getPasswordValidity(), isValidPassword(), setInternalPassword(), wfMsg(), and wfMsgExt().
User::setRealName | ( | $ | str | ) |
User::setToken | ( | $ | token = false | ) |
Set the random token (used for persistent authentication) Called from loadDefaults() among other places.
$token | String|bool If specified, set the token to this value |
Definition at line 2061 of file User.php.
References $wgProxyKey, $wgSecretKey, MWCryptRand\generateHex(), and load().
Referenced by getToken(), setCookies(), and setInternalPassword().
If this user is logged-in and blocked, block any IP address they've successfully logged in from.
Definition at line 2977 of file User.php.
References isBlocked(), isLoggedIn(), and spreadBlock().
User::spreadBlock | ( | ) | [protected] |
If this (non-anonymous) user is blocked, block the IP address they've successfully logged in from.
Definition at line 2989 of file User.php.
References getName(), getRequest(), load(), Block\newFromTarget(), and wfDebug().
Referenced by spreadAnyEditBlock().
User::updateNewtalk | ( | $ | field, |
$ | id | ||
) | [protected] |
Add or update the new messages flag.
$field | String 'user_ip' for anonymous users, 'user_id' otherwise |
$id | String|Int User's IP address for anonymous users, User ID otherwise |
Definition at line 1835 of file User.php.
References wfDebug(), and wfGetDB().
Referenced by setNewtalk().
Check whether to enable new pages patrol features for this user.
Definition at line 2567 of file User.php.
References $wgUseNPPatrol, $wgUseRCPatrol, and isAllowedAny().
Check whether to enable recent changes patrol features for this user.
Definition at line 2558 of file User.php.
References $wgUseRCPatrol, and isAllowedAny().
User::validateCache | ( | $ | timestamp | ) |
static User::whoIs | ( | $ | id | ) | [static] |
Get the username corresponding to a given user ID.
$id | Int User ID |
Definition at line 450 of file User.php.
References $dbr, and wfGetDB().
Referenced by Title\checkActionPermissions(), Title\checkUserBlock(), UserrightsPage\fetchUser(), ApiQueryUserInfo\getCurrentUserInfo(), Revision\getRawUserText(), Block\load(), and Block\newFromDB().
static User::whoIsReal | ( | $ | id | ) | [static] |
User::$mAllRights = false [static] |
String Cached results of getAllRights()
Definition at line 162 of file User.php.
Referenced by getAllRights().
User::$mCacheVars [static] |
array( 'mId', 'mName', 'mRealName', 'mPassword', 'mNewpassword', 'mNewpassTime', 'mEmail', 'mTouched', 'mToken', 'mEmailAuthenticated', 'mEmailToken', 'mEmailTokenExpires', 'mRegistration', 'mEditCount', 'mGroups', 'mOptionOverrides', )
Array of Strings 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.
User::$mCoreRights [static] |
array( 'apihighlimits', 'autoconfirmed', 'autopatrol', 'bigdelete', 'block', 'blockemail', 'bot', 'browsearchive', 'createaccount', 'createpage', 'createtalk', 'delete', 'deletedhistory', 'deletedtext', 'deleterevision', 'edit', 'editinterface', 'editusercssjs', #deprecated 'editusercss', 'edituserjs', 'hideuser', 'import', 'importupload', 'ipblock-exempt', 'markbotedits', 'mergehistory', 'minoredit', 'move', 'movefile', 'move-rootuserpages', 'move-subpages', 'nominornewtalk', 'noratelimit', 'override-export-depth', 'patrol', 'protect', 'proxyunbannable', 'purge', 'read', 'reupload', 'reupload-shared', 'rollback', 'sendemail', 'siteadmin', 'suppressionlog', 'suppressredirect', 'suppressrevision', 'unblockself', 'undelete', 'unwatchedpages', 'upload', 'upload_by_url', 'userrights', 'userrights-interwiki', 'writeapi', )
Array of Strings Core rights.
Each of these should have a corresponding message of the form "right-$right".
Definition at line 102 of file User.php.
Referenced by getAllRights().
User::$mFrom |
String Initialization data source if mLoadedItems!==true.
May be one of:
Use the User::newFrom*() family of functions to set this.
User::$mLoadedItems = array() [private] |
User::$mNewtalk |
User::$mOptionsLoaded |
Definition at line 66 of file User.php.
Referenced by getEditToken().
const User::MW_USER_VERSION = MW_USER_VERSION |
Definition at line 65 of file User.php.
Referenced by saveToCache().