* This is slightly less efficient than newFromId(), so use newFromId() if
* you have both an ID and a name handy.
*
- * @param string $name Username, validated by Title:newFromText()
- * @param mixed $validate Validate username. Takes the same parameters as
+ * @param $name String: username, validated by Title:newFromText()
+ * @param $validate Mixed: validate username. Takes the same parameters as
* User::getCanonicalName(), except that true is accepted as an alias
* for 'valid', for BC.
*
* @return User object, or null if the username is invalid. If the username
* is not present in the database, the result will be a user object with
* a name, zero user ID and default settings.
- * @static
*/
static function newFromName( $name, $validate = 'valid' ) {
if ( $validate === true ) {
*
* If the code is invalid or has expired, returns NULL.
*
- * @param string $code
+ * @param $code string
* @return User
- * @static
*/
static function newFromConfirmationCode( $code ) {
$dbr = wfGetDB( DB_SLAVE );
* login credentials are invalid, the result is an anonymous user.
*
* @return User
- * @static
*/
static function newFromSession() {
$user = new User;
/**
* Get username given an id.
- * @param integer $id Database user id
+ * @param $id Integer: database user id
* @return string Nickname of a user
- * @static
*/
static function whoIs( $id ) {
$dbr = wfGetDB( DB_SLAVE );
/**
* Get the real name of a user given their identifier
*
- * @param int $id Database user id
+ * @param $id Int: database user id
* @return string Real name of a user
*/
static function whoIsReal( $id ) {
/**
* Get database id given a user name
- * @param string $name Nickname of a user
+ * @param $name String: nickname of a user
* @return integer|null Database user id (null: if non existent
* @static
*/
* addresses like this, if we allowed accounts like this to be created
* new users could get the old edits of these anonymous users.
*
- * @static
- * @param string $name Nickname of a user
+ * @param $name String: nickname of a user
* @return bool
*/
static function isIP( $name ) {
* is longer than the maximum allowed username size or doesn't begin with
* a capital letter.
*
- * @param string $name
+ * @param $name string
* @return bool
- * @static
*/
static function isValidUserName( $name ) {
global $wgContLang, $wgMaxNameChars;
* If an account already exists in this form, login will be blocked
* by a failure to pass this function.
*
- * @param string $name
+ * @param $name string
* @return bool
*/
static function isUsableName( $name ) {
* rather than in isValidUserName() to avoid disrupting
* existing accounts.
*
- * @param string $name
+ * @param $name string
* @return bool
*/
static function isCreatableName( $name ) {
/**
* Is the input a valid password for this user?
*
- * @param string $password Desired password
+ * @param $password String: desired password
* @return bool
*/
function isValidPassword( $password ) {
*
* @todo Check for RFC 2822 compilance (bug 959)
*
- * @param string $addr email address
+ * @param $addr String: email address
* @return bool
*/
public static function isValidEmailAddr( $addr ) {
/**
* Given unvalidated user input, return a canonical username, or false if
* the username is invalid.
- * @param string $name
- * @param mixed $validate Type of validation to use:
- * false No validation
- * 'valid' Valid for batch processes
- * 'usable' Valid for batch processes and login
- * 'creatable' Valid for batch processes, login and account creation
+ * @param $name string
+ * @param $validate Mixed: type of validation to use:
+ * false No validation
+ * 'valid' Valid for batch processes
+ * 'usable' Valid for batch processes and login
+ * 'creatable' Valid for batch processes, login and account creation
*/
static function getCanonicalName( $name, $validate = 'valid' ) {
# Force usernames to capital
*
* It should not be static and some day should be merged as proper member function / deprecated -- domas
*
- * @param int $uid The user ID to check
+ * @param $uid Int: the user ID to check
* @return int
- * @static
*/
static function edits( $uid ) {
wfProfileIn( __METHOD__ );
* @todo hash random numbers to improve security, like generateToken()
*
* @return string
- * @static
*/
static function randomPassword() {
global $wgMinimalPasswordLength;
/**
* Clear various cached data stored in this object.
- * @param string $reloadFrom Reload user and user_groups table data from a
+ * @param $reloadFrom String: reload user and user_groups table data from a
* given source. May be "name", "id", "defaults", "session" or false for
* no reload.
*/
* and add the default language variants.
* Not really private cause it's called by Language class
* @return array
- * @static
* @private
*/
static function getDefaultOptions() {
/**
* Get a given default option value.
*
- * @param string $opt
+ * @param $opt string
* @return string
*/
public static function getDefaultOption( $opt ) {
/**
* Get blocking information
* @private
- * @param bool $bFromSlave Specify whether to check slave or master. To improve performance,
- * non-critical checks are done against slaves. Check when actually saving should be done against
- * master.
+ * @param $bFromSlave Bool: specify whether to check slave or master. To
+ * improve performance, non-critical checks are done
+ * against slaves. Check when actually saving should be
+ * done against master.
*/
function getBlockedStatus( $bFromSlave = true ) {
global $wgEnableSorbs, $wgProxyWhitelist;
* last-hit counters will be shared across wikis.
*
* @return bool true if a rate limiter was tripped
- * @public
*/
function pingLimiter( $action='edit' ) {
/**
* Return the title dbkey form of the name, for eg user pages.
* @return string
- * @public
*/
function getTitleKey() {
return str_replace( ' ', '_', $this->getName() );
* Perform a user_newtalk check, uncached.
* Use getNewtalk for a cached check.
*
- * @param string $field
- * @param mixed $id
- * @param bool $fromMaster True to fetch from the master, false for a slave
+ * @param $field string
+ * @param $id mixed
+ * @param $fromMaster Bool: true to fetch from the master, false for a slave
* @return bool
* @private
*/
/**
* Add or update the
- * @param string $field
- * @param mixed $id
+ * @param $field string
+ * @param $id mixed
* @private
*/
function updateNewtalk( $field, $id ) {
/**
* Clear the new messages flag for the given user
- * @param string $field
- * @param mixed $id
+ * @param $field string
+ * @param $id mixed
* @private
*/
function deleteNewtalk( $field, $id ) {
/**
* Update the 'You have new messages!' status.
- * @param bool $val
+ * @param $val bool
*/
function setNewtalk( $val ) {
if( wfReadOnly() ) {
* wipes it, so the account cannot be logged in until
* a new password is set, for instance via e-mail.
*
- * @param string $str
+ * @param $str string
* @throws PasswordError on failure
*/
function setPassword( $str ) {
* Set the password and reset the random token no matter
* what.
*
- * @param string $str
+ * @param $str string
*/
function setInternalPassword( $str ) {
$this->load();
}
/**
- * @param string $oname The option to check
- * @param string $defaultOverride A default value returned if the option does not exist
+ * @param $oname String: the option to check
+ * @param $defaultOverride String: A default value returned if the option does not exist
* @return string
*/
function getOption( $oname, $defaultOverride = '' ) {
}
/**
- * @param string $oname The option to check
+ * @param $oname String: the option to check
* @return bool False if the option is not selected, true if it is
*/
function getBoolOption( $oname ) {
/**
* Get an option as an integer value from the source string.
- * @param string $oname The option to check
- * @param int $default Optional value to return if option is unset/blank.
+ * @param $oname String: the option to check
+ * @param $default Int: optional value to return if option is unset/blank.
* @return int
*/
function getIntOption( $oname, $default=0 ) {
* 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
- * @param boolean $recache Don't use the cache
+ * @param $recache Boolean: don't use the cache
* @return array of strings
*/
function getEffectiveGroups( $recache = false ) {
/**
* Add the user to the given group.
* This takes immediate effect.
- * @param string $group
+ * @param $group string
*/
function addGroup( $group ) {
$dbw = wfGetDB( DB_MASTER );
/**
* Remove the user from the given group.
* This takes immediate effect.
- * @param string $group
+ * @param $group string
*/
function removeGroup( $group ) {
$this->load();
/**
* Check if user is allowed to access a feature / make an action
- * @param string $action Action to be checked
+ * @param $action String: action to be checked
* @return boolean True: action is allowed, False: action should not be allowed
*/
function isAllowed($action='') {
}
/**#@+
- * @param string $title Article title to look at
+ * @param $title Title: article title to look at
*/
/**
'wl_title' => $title->getDBkey(),
'wl_namespace' => $title->getNamespace(),
'wl_user' => $this->getID()
- ), 'User::clearLastVisited'
+ ), __METHOD__
);
}
}
* If e-notif e-mails are on, they will receive notification mails on
* the next change of any watched page.
*
- * @param int $currentUser user ID number
- * @public
+ * @param $currentUser Int: user ID number
*/
function clearAllNotifications( $currentUser ) {
global $wgUseEnotif, $wgShowUpdatedMarker;
/**
* Add a user to the database, return the user object
*
- * @param string $name The user's name
- * @param array $params Associative array of non-default parameters to save to the database:
+ * @param $name String: the user's name
+ * @param $params Associative array of non-default parameters to save to the database:
* password The user's password. Password logins will be disabled if this is omitted.
* newpassword A temporary password mailed to the user
* email The user's email address
/**
* Determine if the user is blocked from using Special:Emailuser.
*
- * @public
* @return boolean
*/
function isBlockedFromEmailuser() {
* Get this user's personal page title.
*
* @return Title
- * @public
*/
function getUserPage() {
return Title::makeTitle( NS_USER, $this->getName() );
* Get this user's talk page title.
*
* @return Title
- * @public
*/
function getTalkPage() {
$title = $this->getUserPage();
/**
* Check to see if the given clear-text password is one of the accepted passwords
- * @param string $password User password.
+ * @param $password String: user password.
* @return bool True if the given password is correct otherwise False.
*/
function checkPassword( $password ) {
* login credentials aren't being hijacked with a foreign form
* submission.
*
- * @param mixed $salt - Optional function-specific data for hash.
- * Use a string or an array of strings.
+ * @param $salt Mixed: optional function-specific data for hash.
+ * Use a string or an array of strings.
* @return string
- * @public
*/
function editToken( $salt = '' ) {
if ( $this->isAnon() ) {
* user's own login session, not a form submission from a third-party
* site.
*
- * @param string $val - the input value to compare
- * @param string $salt - Optional function-specific data for hash
+ * @param $val String: the input value to compare
+ * @param $salt String: optional function-specific data for hash
* @return bool
- * @public
*/
function matchEditToken( $val, $salt = '' ) {
$sessionToken = $this->editToken( $salt );
* Send an e-mail to this user's account. Does not check for
* confirmed status or validity.
*
- * @param string $subject
- * @param string $body
- * @param string $from Optional from address; default $wgPasswordSender will be used otherwise.
+ * @param $subject string
+ * @param $body string
+ * @param $from string: optional from address; default $wgPasswordSender will be used otherwise.
+ * @param $replyto string
* @return mixed True on success, a WikiError object on failure.
*/
function sendMail( $subject, $body, $from = null, $replyto = null ) {
/**
* Return a URL the user can use to confirm their email address.
- * @param $token: accepts the email confirmation token
+ * @param $token accepts the email confirmation token
* @return string
* @private
*/
}
/**
* Return a URL the user can use to invalidate their email address.
- * @param $token: accepts the email confirmation token
+ * @param $token accepts the email confirmation token
* @return string
* @private
*/
}
/**
- * @param array $groups list of groups
+ * @param $groups Array: list of groups
* @return array list of permission key names for given groups combined
*/
static function getGroupPermissions( $groups ) {
}
/**
- * @param string $group key name
+ * @param $group String: key name
* @return string localized descriptive name for group, if provided
*/
static function getGroupName( $group ) {
}
/**
- * @param string $group key name
+ * @param $group String: key name
* @return string localized descriptive name for member of a group, if provided
*/
static function getGroupMember( $group ) {
/**
* Make an old-style password hash
*
- * @param string $password Plain-text password
- * @param string $userId User ID
+ * @param $password String: plain-text password
+ * @param $userId String: user ID
*/
static function oldCrypt( $password, $userId ) {
global $wgPasswordSalt;
/**
* Make a new-style password hash
*
- * @param string $password Plain-text password
- * @param string $salt Salt, may be random or the user ID. False to generate a salt.
+ * @param $password String: plain-text password
+ * @param $salt String: salt, may be random or the user ID. False to generate a salt.
*/
static function crypt( $password, $salt = false ) {
global $wgPasswordSalt;
* 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.
*
- * @param string $hash Password hash
- * @param string $password Plain-text password to compare
- * @param string $userId User ID for old-style password salt
+ * @param $hash String: password hash
+ * @param $password String: plain-text password to compare
+ * @param $userId String: user ID for old-style password salt
*/
static function comparePasswords( $hash, $password, $userId = false ) {
$m = false;