Inherited by PPFuzzUser.
Public Member Functions | |
User () | |
Lightweight constructor for an anonymous user. | |
load () | |
Load the user table data for this object from the source given by mFrom. | |
loadFromId () | |
Load user table data, given mId has already been set. | |
saveToCache () | |
Save user data to the shared cache. | |
isValidPassword ($password) | |
Is the input a valid password for this user? | |
loadDefaults ($name=false) | |
Set cached properties to default. | |
SetupSession () | |
loadFromDatabase () | |
Load user and user_group data from the database. | |
loadFromRow ($row) | |
Initialize this object from a row from the user table. | |
loadGroups () | |
Load the groups from the database if they aren't already loaded. | |
clearInstanceCache ($reloadFrom=false) | |
Clear various cached data stored in this object. | |
getBlockedStatus ($bFromSlave=true) | |
Get blocking information. | |
inSorbsBlacklist ($ip) | |
Whether the given IP is in the SORBS blacklist. | |
inDnsBlacklist ($ip, $base) | |
Whether the given IP is in a given DNS blacklist. | |
isPingLimitable () | |
Is this user subject to rate limiting? | |
pingLimiter ($action='edit') | |
Primitive rate limits: enforce maximum actions per time period to put a brake on flooding. | |
isBlocked ($bFromSlave=true) | |
Check if user is blocked. | |
isBlockedFrom ($title, $bFromSlave=false) | |
Check if user is blocked from editing a particular 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. | |
getBlockId () | |
If user is blocked, return the ID for the block. | |
isBlockedGlobally ($ip= '') | |
Check if user is blocked on all wikis. | |
isLocked () | |
Check if user account is locked. | |
isHidden () | |
Check if user account is hidden. | |
getId () | |
Get the user's ID. | |
setId ($v) | |
Set the user and reload all fields according to a given ID. | |
getName () | |
Get the user name, or the IP of an anonymous user. | |
setName ($str) | |
Set the user name. | |
getTitleKey () | |
Get the user's name escaped by underscores. | |
getNewtalk () | |
Check if the user has new messages. | |
getNewMessageLinks () | |
Return the talk page(s) this user has new messages on. | |
checkNewtalk ($field, $id, $fromMaster=false) | |
Internal uncached check for new messages. | |
updateNewtalk ($field, $id) | |
Add or update the new messages flag. | |
deleteNewtalk ($field, $id) | |
Clear the new messages flag for the given user. | |
setNewtalk ($val) | |
Update the 'You have new messages!' status. | |
invalidateCache () | |
Immediately touch the user data cache for this account. | |
validateCache ($timestamp) | |
Validate the cache for this account. | |
getTouched () | |
Get the user touched timestamp. | |
setPassword ($str) | |
Set the password and reset the random token. | |
setInternalPassword ($str) | |
Set the password and reset the random token unconditionally. | |
getToken () | |
Get the user's current token. | |
setToken ($token=false) | |
Set the random token (used for persistent authentication) Called from loadDefaults() among other places. | |
setCookiePassword ($str) | |
Set the cookie password. | |
setNewpassword ($str, $throttle=true) | |
Set the password for a password reminder or new account email. | |
isPasswordReminderThrottled () | |
Has password reminder email been sent within the last $wgPasswordReminderResendTime hours? | |
getEmail () | |
Get the user's e-mail address. | |
getEmailAuthenticationTimestamp () | |
Get the timestamp of the user's e-mail authentication. | |
setEmail ($str) | |
Set the user's e-mail address. | |
getRealName () | |
Get the user's real name. | |
setRealName ($str) | |
Set the user's real name. | |
getOption ($oname, $defaultOverride= '') | |
Get the user's current setting for a given option. | |
getBoolOption ($oname) | |
Get the user's current setting for a given option, as a boolean value. | |
getIntOption ($oname, $defaultOverride=0) | |
Get the user's current setting for a given option, as a boolean value. | |
setOption ($oname, $val) | |
Set the given option for a user. | |
restoreOptions () | |
Reset all options to the site defaults. | |
getDatePreference () | |
Get the user's preferred date format. | |
getRights () | |
Get the permissions this user has. | |
getGroups () | |
Get the list of explicit group memberships this user has. | |
getEffectiveGroups ($recache=false) | |
Get the list of implicit group memberships this user has. | |
getEditCount () | |
Get the user's edit count. | |
addGroup ($group) | |
Add the user to the given group. | |
removeGroup ($group) | |
Remove the user from the given group. | |
isLoggedIn () | |
Get whether the user is logged in. | |
isAnon () | |
Get whether the user is anonymous. | |
isBot () | |
Get whether the user is a bot. | |
isAllowed ($action= '') | |
Check if user is allowed to access a feature / make an action. | |
useRCPatrol () | |
Check whether to enable recent changes patrol features for this user. | |
useNPPatrol () | |
Check whether to enable new pages patrol features for this user. | |
& | getSkin () |
Get the current skin, loading it if required. | |
isWatched ($title) | |
Check the watched status of an article. | |
addWatch ($title) | |
Watch an article. | |
removeWatch ($title) | |
Stop watching an article. | |
clearNotification (&$title) | |
Clear the user's notification timestamp for the given title. | |
clearAllNotifications ($currentUser) | |
Resets all of the given user's page-change notification timestamps. | |
encodeOptions () | |
Encode this user's options as a string. | |
decodeOptions ($str) | |
Set this user's options from an encoded string. | |
setCookies () | |
Set the default cookies for this session on the user's client. | |
logout () | |
Log this user out. | |
doLogout () | |
Clear the user's cookies and session, and reset the instance cache. | |
saveSettings () | |
Save this user's settings into the database. | |
idForName () | |
If only this user's username is known, and it exists, return the user ID. | |
addToDatabase () | |
Add this existing user object to the database. | |
spreadBlock () | |
If this (non-anonymous) user is blocked, block any IP address they've successfully logged in from. | |
getPageRenderingHash () | |
Generate a string which will be different for any combination of user options which would produce different parser output. | |
isBlockedFromCreateAccount () | |
Get whether the user is explicitly blocked from account creation. | |
isBlockedFromEmailuser () | |
Get whether the user is blocked from using Special:Emailuser. | |
isAllowedToCreateAccount () | |
Get whether the user is allowed to create an account. | |
setLoaded ($loaded) | |
getUserPage () | |
Get this user's personal page title. | |
getTalkPage () | |
Get this user's talk page title. | |
isNewbie () | |
Determine whether the user is a newbie. | |
isActiveEditor () | |
Is the user active? We check to see if they've made at least X number of edits in the last Y days. | |
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. | |
editToken ($salt= '') | |
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. | |
generateToken ($salt= '') | |
Generate a looking random token for various uses. | |
matchEditToken ($val, $salt= '') | |
Check given value against the token value stored in the session. | |
matchEditTokenNoSuffix ($val, $salt= '') | |
Check given value against the token value stored in the session, ignoring the suffix. | |
sendConfirmationMail () | |
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. | |
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. | |
invalidationTokenUrl ($token) | |
Return a URL the user can use to invalidate their email address. | |
confirmEmail () | |
Mark the e-mail address confirmed. | |
invalidateEmail () | |
Invalidate the user's e-mail confirmation, and unauthenticate the e-mail address if it was already confirmed. | |
setEmailAuthenticationTimestamp ($timestamp) | |
Set the e-mail authentication timestamp. | |
canSendEmail () | |
Is this user allowed to send e-mails within limits of current site configuration? | |
canReceiveEmail () | |
Is this user allowed to receive e-mails within limits of current site configuration? | |
isEmailConfirmed () | |
Is this user's e-mail address valid-looking and confirmed within limits of the current site configuration? | |
isEmailConfirmationPending () | |
Check whether there is an outstanding request for e-mail confirmation. | |
getRegistration () | |
Get the timestamp of account creation. | |
getFirstEditTimestamp () | |
Get the timestamp of the first edit. | |
incEditCount () | |
Increment the user's edit-count field. | |
addNewUserLogEntry ($byEmail=false) | |
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. | |
Static Public Member Functions | |
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. | |
static | idFromName ($name) |
Get database id given a user name. | |
static | isIP ($name) |
Does the string match an anonymous IPv4 address? | |
static | isValidUserName ($name) |
Is the input a valid username? | |
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 | 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 | isValidEmailAddr ($addr) |
Does a string look like an e-mail address? | |
static | getCanonicalName ($name, $validate= 'valid') |
Given unvalidated user input, return a canonical username, or false if the username is invalid. | |
static | edits ($uid) |
Count the number of edits of a user. | |
static | randomPassword () |
Return a random password. | |
static | getDefaultOptions () |
Combine the language default options with any site-specific options and add the default language variants. | |
static | getDefaultOption ($opt) |
Get a given default option value. | |
static | getToggles () |
Get a list of user toggle names. | |
static | createNew ($name, $params=array()) |
Add a user to the database, return the user object. | |
getMaxID () | |
Get the maximum valid user ID. | |
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 | getGroupName ($group) |
Get the localized descriptive name for a group, if it exists. | |
static | getGroupMember ($group) |
Get the localized descriptive name for a member of a group, if it exists. | |
static | getAllGroups () |
Return the set of defined explicit groups. | |
static | getAllRights () |
Get a list of all available permissions. | |
static | getImplicitGroups () |
Get a list of implicit groups. | |
static | getGroupPage ($group) |
Get the title of a page describing a particular group. | |
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 | getRightDescription ($right) |
Get the description of a given right. | |
static | oldCrypt ($password, $userId) |
Make an old-style password hash. | |
static | crypt ($password, $salt=false) |
Make a new-style password hash. | |
static | comparePasswords ($hash, $password, $userId=false) |
Compare a password hash with a plain-text password. | |
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 () |
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 | |
$mDataLoaded | |
Boolean : Whether the cache variables have been loaded. | |
$mAuthLoaded | |
$mFrom | |
String : Initialization data source if mDataLoaded==false. | |
Cache variables | |
$mId | |
$mName | |
$mRealName | |
$mPassword | |
$mNewpassword | |
$mNewpassTime | |
$mEmail | |
$mOptions | |
$mTouched | |
$mToken | |
$mEmailAuthenticated | |
$mEmailToken | |
$mEmailTokenExpires | |
$mRegistration | |
$mGroups | |
Lazy-initialized variables, invalidated with clearInstanceCache | |
$mNewtalk | |
$mDatePreference | |
$mBlockedby | |
$mHash | |
$mSkin | |
$mRights | |
$mBlockreason | |
$mBlock | |
$mEffectiveGroups | |
$mBlockedGlobally | |
$mLocked | |
$mHideName | |
Static Public Attributes | |
static | $mToggles |
{ String :} : A list of default user toggles, i.e., boolean user preferences that are displayed by Special:Preferences as checkboxes. | |
static | $mCacheVars |
{ String :} : List of member variables which are saved to the shared cache (memcached). | |
static | $mCoreRights |
{ String :} : Core rights. | |
static | $mAllRights = false |
String : Cached results of getAllRights() | |
Protected Member Functions | |
setCookie ($name, $value, $exp=0) | |
Set a cookie on the user's client. | |
clearCookie ($name) | |
Clear a cookie on the user's client. | |
getTokenUrl ($page, $token) | |
Internal function to format the e-mail validation/invalidation URLs. | |
Private Member Functions | |
loadFromSession () | |
Load user data from the session or login cookie. | |
clearSharedCache () | |
Clear user data from memcached. | |
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. |
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.
Definition at line 43 of file User.php.
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 2041 of file User.php.
References $dbw, getEffectiveGroups(), getGroupPermissions(), getId(), invalidateCache(), loadGroups(), and wfGetDB().
User::addNewUserLogEntry | ( | $ | byEmail = false |
) |
Add a newuser log entry for this user.
$byEmail | Boolean: account made by email? |
Definition at line 3372 of file User.php.
References $action, $wgContLang, $wgNewUserLog, $wgUser, getId(), getName(), getUserPage(), and wfMsgForContent().
User::addNewUserLogEntryAutoCreate | ( | ) |
Add an autocreate newuser log entry for this user Used by things like CentralAuth and perhaps other authplugins.
Definition at line 3394 of file User.php.
References $wgNewUserLog, getId(), and getUserPage().
User::addToDatabase | ( | ) |
Add this existing user object to the database.
Definition at line 2509 of file User.php.
References $dbw, clearInstanceCache(), encodeOptions(), load(), and wfGetDB().
User::addWatch | ( | $ | title | ) |
Watch an article.
Definition at line 2185 of file User.php.
References $title, WatchedItem::fromUserTitle(), and invalidateCache().
User::blockedBy | ( | ) |
If user is blocked, return the name of the user who placed the block.
Definition at line 1319 of file User.php.
References getBlockedStatus().
User::blockedFor | ( | ) |
If user is blocked, return the specified reason for the block.
Definition at line 1328 of file User.php.
References getBlockedStatus().
User::canReceiveEmail | ( | ) |
Is this user allowed to receive e-mails within limits of current site configuration?
Definition at line 2991 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 2976 of file User.php.
References $wgEnableEmail, $wgEnableUserEmail, isEmailConfirmed(), and wfRunHooks().
User::checkNewtalk | ( | $ | field, | |
$ | id, | |||
$ | fromMaster = false | |||
) |
Internal uncached check for new messages.
$field | String : 'user_ip' for anonymous users, 'user_id' otherwise | |
$id | String : or Integer : : User's IP address for anonymous users, User ID otherwise | |
$fromMaster | Boolean : true to fetch from the master, false for a slave |
Definition at line 1528 of file User.php.
References $db, $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 2709 of file User.php.
References $password, $wgAuth, isValidPassword(), and load().
User::checkTemporaryPassword | ( | $ | plaintext | ) |
Check if the given clear-text password matches the temporary password sent by e-mail for password reset operations.
Definition at line 2749 of file User.php.
References $wgNewPasswordExpiry, getId(), load(), and wfTimestamp().
User::clearAllNotifications | ( | $ | currentUser | ) |
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.
$currentUser | Integer : User ID |
Definition at line 2268 of file User.php.
References $dbw, $wgShowUpdatedMarker, $wgUseEnotif, 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 2339 of file User.php.
References $name, and setCookie().
Referenced by doLogout(), and setCookies().
User::clearInstanceCache | ( | $ | reloadFrom = false |
) |
Clear various cached data stored in this object.
$reloadFrom | 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 964 of file User.php.
Referenced by addToDatabase(), doLogout(), setId(), and User().
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.
Definition at line 2207 of file User.php.
References $dbw, $title, $wgShowUpdatedMarker, $wgUseEnotif, $wgUser, getId(), getName(), isAnon(), setNewtalk(), wfGetDB(), wfReadOnly(), and wfRunHooks().
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 1637 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 : User ID for old-style password salt |
Definition at line 3346 of file User.php.
References $password, $result, $type, oldCrypt(), and wfRunHooks().
User::confirmationToken | ( | &$ | expiration | ) |
Generate, store, and return a new e-mail confirmation code.
A hash (unsalted, since it's used as a key) is stored.
[out] | &$expiration | Mixed : Accepts the expiration time |
Definition at line 2883 of file User.php.
References generateToken(), load(), and wfTimestamp().
Referenced by sendConfirmationMail().
User::confirmationTokenUrl | ( | $ | token | ) |
Return a URL the user can use to confirm their email address.
$token | String : Accepts the email confirmation token |
Definition at line 2901 of file User.php.
References getTokenUrl().
Referenced by sendConfirmationMail().
User::confirmEmail | ( | ) |
Mark the e-mail address confirmed.
Definition at line 2942 of file User.php.
References setEmailAuthenticationTimestamp(), 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 | { String :} : Non-default parameters to save to the database:
|
Definition at line 2471 of file User.php.
References $dbw, $fields, $name, $user, newFromId(), and wfGetDB().
static User::crypt | ( | $ | password, | |
$ | salt = false | |||
) | [static] |
Make a new-style password hash.
$password | String : Plain-text password | |
$salt | String : Optional salt, may be random or the user ID. If unspecified or false, will generate one automatically |
Definition at line 3319 of file User.php.
References $password, $wgPasswordSalt, wfGenerateToken(), and wfRunHooks().
Referenced by setInternalPassword(), and setNewpassword().
User::decodeOptions | ( | $ | str | ) |
Set this user's options from an encoded string.
$str | String : Encoded options to import |
Definition at line 2311 of file User.php.
References $s.
Referenced by loadFromRow().
User::deleteNewtalk | ( | $ | field, | |
$ | id | |||
) |
Clear the new messages flag for the given user.
$field | String : 'user_ip' for anonymous users, 'user_id' otherwise | |
$id | String : or Integer : : User's IP address for anonymous users, User ID otherwise |
Definition at line 1568 of file User.php.
References $dbw, wfDebug(), and wfGetDB().
Referenced by setNewtalk().
User::doLogout | ( | ) |
Clear the user's cookies and session, and reset the instance cache.
Definition at line 2393 of file User.php.
References clearCookie(), clearInstanceCache(), setCookie(), and wfTimestampNow().
Referenced by logout().
static User::edits | ( | $ | uid | ) | [static] |
Count the number of edits of a user.
$uid | User ID to check |
Definition at line 705 of file User.php.
References $count, $dbr, $dbw, wfGetDB(), wfProfileIn(), and wfProfileOut().
Referenced by getEditCount(), and Linker::userToolLinks().
User::editToken | ( | $ | salt = '' |
) |
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 : or { String :} : Optional function-specific data for hashing |
Definition at line 2769 of file User.php.
References generateToken(), and isAnon().
Referenced by matchEditToken(), and matchEditTokenNoSuffix().
User::encodeOptions | ( | ) |
Encode this user's options as a string.
Definition at line 2293 of file User.php.
References $s, getDefaultOptions(), and load().
Referenced by addToDatabase(), and saveSettings().
User::generateToken | ( | $ | salt = '' |
) |
Generate a looking random token for various uses.
$salt | String : Optional salt value |
Definition at line 2792 of file User.php.
Referenced by confirmationToken(), and editToken().
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 3138 of file User.php.
References $wgGroupPermissions.
Referenced by UsersPager::__construct(), UserrightsPage::changeableGroups(), ApiQueryAllUsers::execute(), UsersPager::getAllGroups(), and ApiQueryAllUsers::getAllowedParams().
static User::getAllRights | ( | ) | [static] |
Get a list of all available permissions.
Definition at line 3150 of file User.php.
References $wgAvailableRights, and wfRunHooks().
User::getBlockedStatus | ( | $ | bFromSlave = true |
) |
Get blocking information.
$bFromSlave | Boolean : 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 1046 of file User.php.
References $wgEnableSorbs, $wgProxyWhitelist, inSorbsBlacklist(), isAllowed(), isLoggedIn(), load(), spreadBlock(), wfDebug(), wfGetIP(), wfIsLocallyBlockedProxy(), wfMsg(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by blockedBy(), blockedFor(), getBlockId(), isBlocked(), isBlockedFromCreateAccount(), isBlockedFromEmailuser(), and isHidden().
User::getBlockId | ( | ) |
If user is blocked, return the ID for the block.
Definition at line 1337 of file User.php.
References 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 1893 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 : or Boolean : : Type of validation to use:
|
Definition at line 650 of file User.php.
References $name, $t, $wgAuth, $wgContLang, isCreatableName(), isUsableName(), isValidUserName(), Title::makeTitle(), and Title::newFromText().
Referenced by ApiRollback::execute(), ApiQueryUsers::execute(), newFromName(), ApiQueryContributions::prepareUsername(), ApiQueryBlocks::prepareUsername(), and wfSpecialRestrictUser().
User::getDatePreference | ( | ) |
Get the user's preferred date format.
Definition at line 1955 of file User.php.
References $wgLang, and getOption().
Referenced by getPageRenderingHash().
static User::getDefaultOption | ( | $ | opt | ) | [static] |
Get a given default option value.
$opt | String : Name of option to retrieve |
Definition at line 1012 of file User.php.
References getDefaultOptions().
Referenced by SkinMonoBookCBT::body_ondblclick(), CoreParserFunctions::gender(), Linker::makeImageLink2(), ImagePage::openShowImage(), and PreferencesForm::validateGender().
static User::getDefaultOptions | ( | ) | [static] |
Combine the language default options with any site-specific options and add the default language variants.
Definition at line 985 of file User.php.
References $wgContLang, $wgDefaultUserOptions, and $wgNamespacesToBeSearchedDefault.
Referenced by Language::dateFormat(), encodeOptions(), ApiQueryUserInfo::getCurrentUserInfo(), getDefaultOption(), userOptions::getDefaultOptionsNames(), Language::getDefaultUserOptions(), getOption(), userOptions::LISTER(), restoreOptions(), setOption(), and userOptions::USAGER().
User::getEditCount | ( | ) |
Get the user's edit count.
Definition at line 2023 of file User.php.
References edits(), and getId().
Referenced by Autopromote::checkCondition(), and loadFromDatabase().
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 | Boolean : Whether to avoid the cache |
Definition at line 2000 of file User.php.
References Autopromote::getAutopromoteGroups(), getGroups(), getId(), and wfRunHooks().
Referenced by addGroup(), getRights(), isPingLimitable(), and removeGroup().
User::getEmail | ( | ) |
Get the user's e-mail address.
Definition at line 1816 of file User.php.
References load(), and wfRunHooks().
Referenced by Autopromote::checkCondition().
User::getEmailAuthenticationTimestamp | ( | ) |
Get the timestamp of the user's e-mail authentication.
Definition at line 1826 of file User.php.
References load(), and wfRunHooks().
Referenced by Autopromote::checkCondition(), and isEmailConfirmed().
User::getFirstEditTimestamp | ( | ) |
Get the timestamp of the first edit.
Definition at line 3052 of file User.php.
References $dbr, getId(), wfGetDB(), and wfTimestamp().
Referenced by Autopromote::checkCondition().
static User::getGroupMember | ( | $ | group | ) | [static] |
Get the localized descriptive name for a member of a group, if it exists.
$group | String : Internal group name |
Definition at line 3122 of file User.php.
References $key, $name, $wgMessageCache, wfEmptyMsg(), and wfMsg().
Referenced by UsersPager::buildGroupLink(), and UserrightsPage::groupCheckboxes().
static User::getGroupName | ( | $ | group | ) | [static] |
Get the localized descriptive name for a group, if it exists.
$group | String : Internal group name |
Definition at line 3106 of file User.php.
References $key, $name, $wgMessageCache, wfEmptyMsg(), and wfMsg().
Referenced by UserrightsPage::buildGroupLink(), UsersPager::getAllGroups(), makeGroupLinkHTML(), and makeGroupLinkWiki().
static User::getGroupPage | ( | $ | group | ) | [static] |
Get the title of a page describing a particular group.
$group | String : Internal group name |
Definition at line 3180 of file User.php.
References $page, $title, $wgMessageCache, Title::newFromText(), wfEmptyMsg(), and wfMsgForContent().
Referenced by makeGroupLinkHTML(), and makeGroupLinkWiki().
static User::getGroupPermissions | ( | $ | groups | ) | [static] |
Get the permissions associated with a given list of groups.
$groups | { String :} : List of internal group names |
Definition at line 3070 of file User.php.
References $wgGroupPermissions.
Referenced by addGroup(), getRights(), and removeGroup().
User::getGroups | ( | ) |
Get the list of explicit group memberships this user has.
The implicit * and user groups are not included.
Definition at line 1988 of file User.php.
References load().
Referenced by Autopromote::checkCondition(), 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 3089 of file User.php.
References $wgGroupPermissions.
Referenced by Title::getUserPermissionsErrorsInternal(), ApiMain::makeHelpMsg(), OutputPage::permissionRequired(), and wfSpecialNewimages().
User::getId | ( | ) |
Get the user's ID.
Definition at line 1403 of file User.php.
References isIP(), and load().
Referenced by addGroup(), addNewUserLogEntry(), addNewUserLogEntryAutoCreate(), checkTemporaryPassword(), clearNotification(), getEditCount(), getEffectiveGroups(), getFirstEditTimestamp(), getRegistration(), incEditCount(), pingLimiter(), setNewtalk(), and UploadForm::userCanReUpload().
static User::getImplicitGroups | ( | ) | [static] |
Get a list of implicit groups.
Definition at line 3167 of file User.php.
References $wgImplicitGroups, and wfRunHooks().
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 | Integer : A default value returned if the option does not exist |
Definition at line 1906 of file User.php.
References getOption().
User::getMaxID | ( | ) | [static] |
User::getName | ( | ) |
Get the user name, or the IP of an anonymous user.
Definition at line 1428 of file User.php.
References load(), IP::sanitizeIP(), and wfGetIP().
Referenced by addNewUserLogEntry(), clearNotification(), getNewtalk(), getTitleKey(), getUserPage(), idForName(), isActiveEditor(), isBlockedFrom(), isBlockedGlobally(), Credits::link(), RdfMetaData::person(), pingLimiter(), sendConfirmationMail(), setCookies(), and setNewtalk().
User::getNewMessageLinks | ( | ) |
Return the talk page(s) this user has new messages on.
Definition at line 1505 of file User.php.
References getNewtalk(), getUserPage(), wfRunHooks(), and wfWikiID().
User::getNewtalk | ( | ) |
Check if the user has new messages.
Definition at line 1472 of file User.php.
References $key, $wgMemc, checkNewtalk(), getName(), load(), and wfMemcKey().
Referenced by getNewMessageLinks().
User::getOption | ( | $ | oname, | |
$ | defaultOverride = '' | |||
) |
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 |
Reimplemented in PPFuzzUser.
Definition at line 1869 of file User.php.
References getDefaultOptions(), and load().
Referenced by canReceiveEmail(), getBoolOption(), getDatePreference(), getIntOption(), getPageRenderingHash(), getSkin(), and setCookies().
User::getPageRenderingHash | ( | ) |
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 will 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 2568 of file User.php.
References $wgContLang, $wgLang, $wgRenderHashAppend, $wgUseDynamicDates, getDatePreference(), getOption(), and wfRunHooks().
User::getRealName | ( | ) |
Get the user's real name.
Definition at line 1846 of file User.php.
References load().
Referenced by Credits::link(), RdfMetaData::person(), and Credits::userLink().
User::getRegistration | ( | ) |
Get the timestamp of account creation.
Definition at line 3040 of file User.php.
References getId().
Referenced by Autopromote::checkCondition().
static User::getRightDescription | ( | $ | right | ) | [static] |
Get the description of a given right.
$right | String : Right to query |
Definition at line 3285 of file User.php.
References $key, $name, $wgMessageCache, wfEmptyMsg(), and wfMsg().
Referenced by SpecialListGroupRights::formatPermissions().
User::getRights | ( | ) |
Get the permissions this user has.
Definition at line 1973 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 2151 of file User.php.
References $wgAllowUserSkin, $wgDefaultSkin, $wgRequest, getOption(), Skin::newFromKey(), wfProfileIn(), and wfProfileOut().
User::getTalkPage | ( | ) |
Get this user's talk page title.
Definition at line 2648 of file User.php.
References $title, and getUserPage().
User::getTitleKey | ( | ) |
static User::getToggles | ( | ) | [static] |
Get a list of user toggle names.
Definition at line 1025 of file User.php.
References $wgContLang, $wgUseRCPatrol, and wfRunHooks().
User::getToken | ( | ) |
User::getTokenUrl | ( | $ | page, | |
$ | token | |||
) | [protected] |
Internal function to format the e-mail validation/invalidation URLs.
This uses $wgArticlePath directly as 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 2928 of file User.php.
References $wgArticlePath, and wfExpandUrl().
Referenced by confirmationTokenUrl(), and invalidationTokenUrl().
User::getTouched | ( | ) |
User::getUserPage | ( | ) |
Get this user's personal page title.
Definition at line 2639 of file User.php.
References getName(), and Title::makeTitle().
Referenced by addNewUserLogEntry(), addNewUserLogEntryAutoCreate(), getNewMessageLinks(), getTalkPage(), Credits::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 451 of file User.php.
References $dbr, $name, $s, Title::makeTitleSafe(), and wfGetDB().
Referenced by bottomLinks(), SkinTemplate::buildNavUrls(), DeletedContributionsPage::execute(), SpecialContributions::execute(), ApiQueryLogEvents::execute(), UsersPager::getQueryInfo(), LogPage::getTitleLink(), SkinMonoBookCBT::getUserPageIdIp(), LogImporter::importLine(), WikiRevision::importLogItem(), LogPager::limitUser(), load(), SkinStandard::quickBar(), SkinCologneBlue::quickBar(), EditPage::showIntro(), and wfSpecialRestrictUser().
User::incEditCount | ( | ) |
User::inDnsBlacklist | ( | $ | ip, | |
$ | base | |||
) |
Whether the given IP is in a given DNS blacklist.
$ip | String : IP to check | |
$base | String : URL of the DNS blacklist |
Definition at line 1135 of file User.php.
References IP::isIPv4(), wfDebug(), wfProfileIn(), and wfProfileOut().
Referenced by inSorbsBlacklist().
User::inSorbsBlacklist | ( | $ | ip | ) |
Whether the given IP is in the SORBS blacklist.
$ip | String : IP to check |
Definition at line 1121 of file User.php.
References $wgEnableSorbs, $wgSorbsUrl, and inDnsBlacklist().
Referenced by getBlockedStatus().
User::invalidateCache | ( | ) |
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 1650 of file User.php.
References $dbw, clearSharedCache(), load(), newTouchedTimestamp(), and wfGetDB().
Referenced by addGroup(), addWatch(), incEditCount(), removeGroup(), removeWatch(), and setNewtalk().
User::invalidateEmail | ( | ) |
Invalidate the user's e-mail confirmation, and unauthenticate the e-mail address if it was already confirmed.
Definition at line 2953 of file User.php.
References load(), and setEmailAuthenticationTimestamp().
User::invalidationTokenUrl | ( | $ | token | ) |
Return a URL the user can use to invalidate their email address.
$token | String : Accepts the email confirmation token |
Definition at line 2910 of file User.php.
References getTokenUrl().
Referenced by sendConfirmationMail().
User::isActiveEditor | ( | ) |
Is the user active? We check to see if they've made at least X number of edits in the last Y days.
Definition at line 2684 of file User.php.
References $count, $dbr, $res, $wgActiveUserDays, $wgActiveUserEditCount, getName(), and wfGetDB().
User::isAllowed | ( | $ | action = '' |
) |
Check if user is allowed to access a feature / make an action.
$action | String : action to be checked |
Definition at line 2114 of file User.php.
References $action, $wgUseNPPatrol, $wgUseRCPatrol, and getRights().
Referenced by getBlockedStatus(), isAllowedToCreateAccount(), isBot(), isNewbie(), isPingLimitable(), useNPPatrol(), UploadForm::userCanReUpload(), and useRCPatrol().
User::isAllowedToCreateAccount | ( | ) |
Get whether the user is allowed to create an account.
Definition at line 2623 of file User.php.
References isAllowed(), and isBlockedFromCreateAccount().
User::isAnon | ( | ) |
Get whether the user is anonymous.
Definition at line 2095 of file User.php.
References isLoggedIn().
Referenced by clearNotification(), editToken(), incEditCount(), isEmailConfirmed(), RdfMetaData::person(), saveToCache(), setNewtalk(), and Credits::userLink().
User::isBlocked | ( | $ | bFromSlave = true |
) |
Check if user is blocked.
$bFromSlave | Whether to check the slave database instead of the master |
Definition at line 1284 of file User.php.
References getBlockedStatus(), and wfDebug().
Referenced by isBlockedFrom().
User::isBlockedFrom | ( | $ | title, | |
$ | bFromSlave = false | |||
) |
Check if user is blocked from editing a particular article.
$title | Title to check | |
$bFromSlave | Whether to check the slave database instead of the master |
Definition at line 1297 of file User.php.
References $title, $wgBlockAllowsUTEdit, getName(), isBlocked(), wfDebug(), wfProfileIn(), and wfProfileOut().
User::isBlockedFromCreateAccount | ( | ) |
Get whether the user is explicitly blocked from account creation.
Definition at line 2605 of file User.php.
References getBlockedStatus().
Referenced by isAllowedToCreateAccount().
User::isBlockedFromEmailuser | ( | ) |
Get whether the user is blocked from using Special:Emailuser.
Definition at line 2614 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 1350 of file User.php.
References getName(), IP::isIPAddress(), wfGetIP(), and wfRunHooks().
User::isBot | ( | ) |
Get whether the user is a bot.
Definition at line 2104 of file User.php.
References isAllowed(), and wfDeprecated().
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 character blacklisting may be added here rather than in isValidUserName() to avoid disrupting existing accounts.
$name | String : String to match |
Definition at line 590 of file User.php.
References $name, $wgInvalidUsernameCharacters, and isUsableName().
Referenced by getCanonicalName().
User::isEmailConfirmationPending | ( | ) |
Check whether there is an outstanding request for e-mail confirmation.
Definition at line 3026 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 3005 of file User.php.
References $wgEmailAuthentication, getEmailAuthenticationTimestamp(), isAnon(), load(), and wfRunHooks().
Referenced by canReceiveEmail(), canSendEmail(), and isEmailConfirmationPending().
User::isHidden | ( | ) |
Check if user account is hidden.
Definition at line 1386 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 : String to match |
Definition at line 483 of file User.php.
References $name, and IP::isIPv6().
Referenced by bottomLinks(), SkinTemplate::buildNavUrls(), Article::editUpdates(), ApiRollback::execute(), getId(), SearchEngine::getNearMatch(), DeletedContributionsPage::getSubTitle(), SkinMonoBookCBT::getUserPageIdIp(), initialiseUser(), isValidUserName(), ApiQueryContributions::prepareUsername(), ApiQueryBlocks::prepareUsername(), SkinStandard::quickBar(), EditPage::showIntro(), and wfSpecialRestrictUser().
User::isLocked | ( | ) |
User::isLoggedIn | ( | ) |
Get whether the user is logged in.
Definition at line 2087 of file User.php.
Referenced by getBlockedStatus(), and isAnon().
User::isNewbie | ( | ) |
Determine whether the user is a newbie.
Newbies are either anonymous IPs, or the most recently created accounts.
Definition at line 2674 of file User.php.
References isAllowed().
Referenced by pingLimiter().
User::isPasswordReminderThrottled | ( | ) |
Has password reminder email been sent within the last $wgPasswordReminderResendTime hours?
Definition at line 1802 of file User.php.
References $wgPasswordReminderResendTime, load(), and wfTimestamp().
User::isPingLimitable | ( | ) |
Is this user subject to rate limiting?
Definition at line 1165 of file User.php.
References $wgRateLimitsExcludedGroups, $wgRateLimitsExcludedIPs, getEffectiveGroups(), isAllowed(), and wfGetIP().
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 : String to match |
Definition at line 552 of file User.php.
References $name, $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?
There used to be a regular expression here, it got removed because it rejected valid addresses. Actually just check if there is '@' somewhere in the given address.
$addr | String : E-mail address |
Definition at line 631 of file User.php.
References $result, and wfRunHooks().
Referenced by LoginForm::addNewAccount(), LoginForm::addNewAccountInternal(), Autopromote::checkCondition(), and EmailConfirmation::execute().
User::isValidPassword | ( | $ | password | ) |
Is the input a valid password for this user?
$password | String : Desired password |
Definition at line 605 of file User.php.
References $password, $result, $wgContLang, $wgMinimalPasswordLength, and wfRunHooks().
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 : String to match |
Definition at line 498 of file User.php.
References $name, $wgContLang, $wgMaxNameChars, isIP(), Title::newFromText(), and wfDebugLog().
Referenced by getCanonicalName(), and checkUsernames::main().
User::isWatched | ( | $ | title | ) |
User::load | ( | ) |
Load the user table data for this object from the source given by mFrom.
Reimplemented in PPFuzzUser.
Definition at line 234 of file User.php.
References idFromName(), loadDefaults(), loadFromId(), loadFromSession(), wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by addToDatabase(), checkPassword(), checkTemporaryPassword(), clearSharedCache(), confirmationToken(), encodeOptions(), getBlockedStatus(), getEmail(), getEmailAuthenticationTimestamp(), getGroups(), getId(), getName(), getNewtalk(), getOption(), getRealName(), getToken(), getTouched(), invalidateCache(), invalidateEmail(), isEmailConfirmed(), isPasswordReminderThrottled(), removeGroup(), saveSettings(), saveToCache(), setCookiePassword(), setCookies(), setEmail(), setEmailAuthenticationTimestamp(), setInternalPassword(), setName(), setNewpassword(), setNewtalk(), setOption(), setRealName(), setToken(), spreadBlock(), and validateCache().
User::loadDefaults | ( | $ | name = false |
) |
Set cached properties to default.
Definition at line 762 of file User.php.
References $name, $wgCookiePrefix, setToken(), wfProfileIn(), wfProfileOut(), wfRunHooks(), and wfTimestamp().
Referenced by PPFuzzUser::load(), load(), loadFromDatabase(), loadFromId(), and loadFromSession().
User::loadFromDatabase | ( | ) |
Load user and user_group data from the database.
$this::mId must be set, this is how the user is identified.
Definition at line 884 of file User.php.
References $dbr, $s, getEditCount(), loadDefaults(), loadFromRow(), wfGetDB(), and wfRunHooks().
Referenced by loadFromId().
User::loadFromId | ( | ) |
Load user table data, given mId has already been set.
Definition at line 274 of file User.php.
References $key, $name, $wgMemc, loadDefaults(), loadFromDatabase(), saveToCache(), wfDebug(), and wfMemcKey().
Referenced by load(), and loadFromSession().
User::loadFromRow | ( | $ | row | ) |
Initialize this object from a row from the user table.
$row | { Mixed :} : Row from the user table to load. |
Definition at line 918 of file User.php.
References $row, decodeOptions(), 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 806 of file User.php.
References $result, $wgCookiePrefix, $wgMemc, loadDefaults(), loadFromId(), wfDebug(), wfDebugLog(), and wfRunHooks().
Referenced by load().
User::loadGroups | ( | ) |
Load the groups from the database if they aren't already loaded.
Definition at line 944 of file User.php.
References $dbr, $res, $row, and wfGetDB().
Referenced by addGroup(), removeGroup(), and saveToCache().
User::logout | ( | ) |
Log this user out.
Definition at line 2381 of file User.php.
References $wgUser, 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 3200 of file User.php.
References $text, $title, $wgUser, getGroupName(), and getGroupPage().
Referenced by PreferencesForm::mainPrefsForm().
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 3222 of file User.php.
References $page, $text, $title, getGroupName(), and getGroupPage().
User::matchEditToken | ( | $ | val, | |
$ | salt = '' | |||
) |
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 |
Definition at line 2807 of file User.php.
References editToken(), and wfDebug().
User::matchEditTokenNoSuffix | ( | $ | val, | |
$ | salt = '' | |||
) |
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 |
Definition at line 2823 of file User.php.
References editToken().
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 | Confirmation code |
Definition at line 385 of file User.php.
References $code, $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 | Valid user ID |
Definition at line 368 of file User.php.
References $u.
Referenced by LogPage::addEntry(), RdfMetaData::basics(), userOptions::CHANGER(), SpecialContributions::contributionsSub(), createNew(), Credits::getAuthor(), UsersPager::getGroups(), newFromConfirmationCode(), EnotifNotifyJob::run(), showEmailUser(), 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 | Username, validated by Title::newFromText() | |
$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 346 of file User.php.
References $name, $u, and getCanonicalName().
Referenced by EmailNotification::actuallyNotifyOnPageChange(), LoginForm::addNewAccountInternal(), SpecialResetpass::attemptReset(), LoginForm::authenticateUserData(), ChangePassword::ChangePassword(), deleteDefaultMessages(), IPBlockForm::doMassUserBlock(), Article::editUpdates(), UserrightsPage::fetchUser(), CoreParserFunctions::gender(), DoubleRedirectJob::getUser(), WikiRevision::importOldRevision(), initialiseUser(), LoginForm::mailPassword(), EmailUserForm::newFromURL(), Article::onArticleDelete(), EnotifNotifyJob::run(), RecentChange::save(), IPBlockForm::showForm(), IPUnblockForm::showList(), EmailUserForm::validateEmailTarget(), and wfSpecialBlockme().
static User::newFromRow | ( | $ | row | ) | [static] |
Create a new user object from a user row.
The row should have all fields from the user table in it.
$row | array A row from the user table |
Definition at line 416 of file User.php.
Referenced by ApiQueryUsers::execute(), and UserArrayFromResult::setCurrent().
static User::newFromSession | ( | ) | [static] |
Create a new user object using data from session or cookies.
If the login credentials are invalid, the result is an anonymous user.
Definition at line 404 of file User.php.
References $user.
Referenced by StubUser::_newObject().
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 1625 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 3302 of file User.php.
References $password, and $wgPasswordSalt.
Referenced by comparePasswords(), and wfEncryptPassword().
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 1191 of file User.php.
References $action, $count, $key, $keys, $result, $summary, $wgMemc, $wgRateLimitLog, $wgRateLimits, getGroups(), getId(), getName(), isNewbie(), isPingLimitable(), wfDebug(), wfGetIP(), wfMemcKey(), wfProfileIn(), wfProfileOut(), wfRunHooks(), wfTimestamp(), and wfWikiID().
static User::randomPassword | ( | ) | [static] |
Return a random password.
Sourced from mt_rand, so it's not particularly secure.
Definition at line 741 of file User.php.
References $i, and $wgMinimalPasswordLength.
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 2065 of file User.php.
References $dbw, getEffectiveGroups(), getGroupPermissions(), invalidateCache(), load(), loadGroups(), and wfGetDB().
User::removeWatch | ( | $ | title | ) |
Stop watching an article.
Definition at line 2195 of file User.php.
References $title, WatchedItem::fromUserTitle(), and invalidateCache().
User::restoreOptions | ( | ) |
Reset all options to the site defaults.
Definition at line 1947 of file User.php.
References getDefaultOptions().
User::saveSettings | ( | ) |
Save this user's settings into the database.
Definition at line 2409 of file User.php.
References $dbw, clearSharedCache(), encodeOptions(), getUserPage(), load(), newTouchedTimestamp(), wfGetDB(), wfReadOnly(), and wfRunHooks().
Referenced by sendConfirmationMail().
User::saveToCache | ( | ) |
Save user data to the shared cache.
Definition at line 310 of file User.php.
References $key, $name, $wgMemc, isAnon(), load(), loadGroups(), and wfMemcKey().
Referenced by loadFromId().
User::sendConfirmationMail | ( | ) |
Generate a new e-mail confirmation token and send a confirmation/invalidation mail to the user's given address.
Definition at line 2834 of file User.php.
References $url, $wgLang, confirmationToken(), confirmationTokenUrl(), getName(), invalidationTokenUrl(), saveSettings(), sendMail(), wfGetIP(), and wfMsg().
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 2861 of file User.php.
References $wgPasswordSender, 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 | Integer : Expiration time, as a UNIX time value; if 0 or not specified, use the default $wgCookieExpiration |
Definition at line 2330 of file User.php.
References $name, and $wgRequest.
Referenced by clearCookie(), doLogout(), and setCookies().
User::setCookiePassword | ( | $ | str | ) |
User::setCookies | ( | ) |
Set the default cookies for this session on the user's client.
Definition at line 2346 of file User.php.
References $name, $session, clearCookie(), getName(), getOption(), load(), setCookie(), and wfRunHooks().
User::setEmail | ( | $ | str | ) |
Set the user's e-mail address.
$str | String : New e-mail address |
Definition at line 1836 of file User.php.
References load(), and wfRunHooks().
User::setEmailAuthenticationTimestamp | ( | $ | timestamp | ) |
Set the e-mail authentication timestamp.
$timestamp | String : TS_MW timestamp |
Definition at line 2965 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 | Integer : User ID to reload |
Definition at line 1419 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 1725 of file User.php.
References crypt(), load(), and setToken().
Referenced by setPassword().
User::setLoaded | ( | $ | loaded | ) |
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 1455 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 | Boolean : If true, reset the throttle timestamp to the present |
Definition at line 1789 of file User.php.
References crypt(), load(), and wfTimestampNow().
User::setNewtalk | ( | $ | val | ) |
Update the 'You have new messages!' status.
$val | Boolean : Whether the user has new messages |
Definition at line 1586 of file User.php.
References $changed, $key, $wgMemc, deleteNewtalk(), getId(), getName(), invalidateCache(), isAnon(), load(), updateNewtalk(), wfMemcKey(), and wfReadOnly().
Referenced by clearAllNotifications(), and clearNotification().
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 1920 of file User.php.
References $wgDefaultUserOptions, getDefaultOptions(), and load().
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 1696 of file User.php.
References $wgAuth, $wgMinimalPasswordLength, 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 : If specified, set the token to this value |
Definition at line 1755 of file User.php.
References $key, $wgProxyKey, $wgSecretKey, load(), and wfWikiID().
Referenced by loadDefaults(), and setInternalPassword().
User::SetupSession | ( | ) |
User::spreadBlock | ( | ) |
If this (non-anonymous) user is blocked, block any IP address they've successfully logged in from.
Definition at line 2539 of file User.php.
References load(), Block::newFromDB(), and wfDebug().
Referenced by getBlockedStatus().
User::updateNewtalk | ( | $ | field, | |
$ | id | |||
) |
Add or update the new messages flag.
$field | String : 'user_ip' for anonymous users, 'user_id' otherwise | |
$id | String : or Integer : : User's IP address for anonymous users, User ID otherwise |
Definition at line 1546 of file User.php.
References $dbw, wfDebug(), and wfGetDB().
Referenced by setNewtalk().
User::useNPPatrol | ( | ) |
Check whether to enable new pages patrol features for this user.
Definition at line 2141 of file User.php.
References $wgUseNPPatrol, $wgUseRCPatrol, and isAllowed().
User::User | ( | ) |
Lightweight constructor for an anonymous user.
Use the User::newFrom* factory functions for other kinds of users.
Definition at line 227 of file User.php.
References clearInstanceCache().
User::useRCPatrol | ( | ) |
Check whether to enable recent changes patrol features for this user.
Definition at line 2132 of file User.php.
References $wgUseRCPatrol, and isAllowed().
User::validateCache | ( | $ | timestamp | ) |
static User::whoIs | ( | $ | id | ) | [static] |
Get the username corresponding to a given user ID.
$id | User ID |
Definition at line 430 of file User.php.
References $dbr, and wfGetDB().
Referenced by OutputPage::blockedPage(), UserrightsPage::fetchUser(), ApiQueryUserInfo::getCurrentUserInfo(), Title::getUserPermissionsErrors(), Title::getUserPermissionsErrorsInternal(), LoginForm::userBlockedMessage(), and Block::validateBlockParams().
static User::whoIsReal | ( | $ | id | ) | [static] |
User::$mAllRights = false [static] |
User::$mCacheVars [static] |
Initial value:
array( 'mId', 'mName', 'mRealName', 'mPassword', 'mNewpassword', 'mNewpassTime', 'mEmail', 'mOptions', 'mTouched', 'mToken', 'mEmailAuthenticated', 'mEmailToken', 'mEmailTokenExpires', 'mRegistration', 'mEditCount', 'mGroups', )
Any operation which changes the corresponding database fields must call a cache-clearing function.
User::$mCoreRights [static] |
Initial value:
array( 'apihighlimits', 'autoconfirmed', 'autopatrol', 'bigdelete', 'block', 'blockemail', 'bot', 'browsearchive', 'createaccount', 'createpage', 'createtalk', 'delete', 'deletedhistory', 'deleterevision', 'edit', 'editinterface', 'editusercssjs', 'hideuser', 'import', 'importupload', 'ipblock-exempt', 'markbotedits', 'minoredit', 'move', 'movefile', 'move-rootuserpages', 'move-subpages', 'nominornewtalk', 'noratelimit', 'override-export-depth', 'patrol', 'protect', 'proxyunbannable', 'purge', 'read', 'reupload', 'reupload-shared', 'rollback', 'siteadmin', 'suppressionlog', 'suppressredirect', 'suppressrevision', 'trackback', 'undelete', 'unwatchedpages', 'upload', 'upload_by_url', 'userrights', 'userrights-interwiki', 'writeapi', )
Each of these should have a corresponding message of the form "right-$right".
User::$mDataLoaded |
User::$mFrom |
String : Initialization data source if mDataLoaded==false.
May be one of:
Use the User::newFrom*() family of functions to set this.
User::$mToggles [static] |
Initial value:
array( 'highlightbroken', 'justify', 'hideminor', 'extendwatchlist', 'usenewrc', 'numberheadings', 'showtoolbar', 'editondblclick', 'editsection', 'editsectiononrightclick', 'showtoc', 'rememberpassword', 'editwidth', 'watchcreations', 'watchdefault', 'watchmoves', 'watchdeletion', 'minordefault', 'previewontop', 'previewonfirst', 'nocache', 'enotifwatchlistpages', 'enotifusertalkpages', 'enotifminoredits', 'enotifrevealaddr', 'shownumberswatching', 'fancysig', 'externaleditor', 'externaldiff', 'showjumplinks', 'uselivepreview', 'forceeditsummary', 'watchlisthideminor', 'watchlisthidebots', 'watchlisthideown', 'watchlisthideanons', 'watchlisthideliu', 'ccmeonemails', 'diffonly', 'showhiddencats', 'noconvertlink', 'norollbackdiff', )
This list can be extended via the UserToggles hook or by $wgContLang::getExtraUserToggles().