var $mId, $mName, $mRealName, $mPassword, $mNewpassword, $mNewpassTime,
$mEmail, $mTouched, $mToken, $mEmailAuthenticated,
$mEmailToken, $mEmailTokenExpires, $mRegistration, $mGroups, $mOptionOverrides,
- $mCookiePassword;
+ $mCookiePassword, $mEditCount, $mAllowUsertalk;
//@}
/**
* @var Block
*/
var $mBlock;
+
+ /**
+ * @var Block
+ */
private $mBlockedFromCreateAccount = false;
static $idCacheByName = array();
$this->clearInstanceCache( 'defaults' );
}
+ /**
+ * @return String
+ */
function __toString(){
return $this->getName();
}
//@}
-
/**
* Get the username corresponding to a given user ID
* @param $id Int User ID
* - 'valid' Valid for batch processes
* - 'usable' Valid for batch processes and login
* - 'creatable' Valid for batch processes, login and account creation
+ *
+ * @return bool|string
*/
public static function getCanonicalName( $name, $validate = 'valid' ) {
# Force usernames to capital
*
* @note This no longer clears uncached lazy-initialised properties;
* the constructor does that instead.
+ *
+ * @param $name string
*/
private function loadDefaults( $name = false ) {
wfProfileIn( __METHOD__ );
/**
* Clear various cached data stored in this object.
- * @param $reloadFrom String Reload user and user_groups table data from a
+ * @param $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.
*/
/**
* Check if an IP address is in the local proxy list
+ *
+ * @param $ip string
+ *
* @return bool
*/
public static function isLocallyBlockedProxy( $ip ) {
/**
* Validate the cache for this account.
* @param $timestamp String A timestamp in TS_MW format
+ *
+ * @return bool
*/
public function validateCache( $timestamp ) {
$this->load();
*
* @param $str String New password to set
* @throws PasswordError on failure
+ *
+ * @return bool
*/
public function setPassword( $str ) {
global $wgAuth;
* Set the random token (used for persistent authentication)
* Called from loadDefaults() among other places.
*
- * @param $token String If specified, set the token to this value
+ * @param $token String|bool If specified, set the token to this value
*/
public function setToken( $token = false ) {
global $wgSecretKey, $wgProxyKey;
/**
* Get the user preferred stub threshold
+ *
+ * @return int
*/
public function getStubThreshold() {
global $wgMaxArticleSize; # Maximum article size, in Kb
/**
* Check if user is allowed to access a feature / make an action
- * @param varargs String permissions to test
+ *
+ * @internal param \String $varargs permissions to test
* @return Boolean: True if user is allowed to perform *any* of the given actions
+ *
+ * @return bool
*/
public function isAllowedAny( /*...*/ ){
$permissions = func_get_args();
}
/**
- * @param varargs String
+ *
+ * @internal param $varargs string
* @return bool True if the user is allowed to perform *all* of the given actions
*/
public function isAllowedAll( /*...*/ ){
/**
* Internal mechanics of testing a permission
* @param $action String
- * @paramn $ns int Namespace optional
+ * @param $ns int|null Namespace optional
* @return bool
*/
public function isAllowed( $action = '', $ns = null ) {
/**
* Check if the given clear-text password matches the temporary password
* sent by e-mail for password reset operations.
+ *
+ * @param $plaintext string
+ *
* @return Boolean: True if matches, false otherwise
*/
public function checkTemporaryPassword( $plaintext ) {
* @note Call saveSettings() after calling this function to commit
* this change to the database.
*
- * @param[out] &$expiration \mixed Accepts the expiration time
+ * @param &$expiration \mixed Accepts the expiration time
* @return String New token
*/
private function confirmationToken( &$expiration ) {
* Mark the e-mail address confirmed.
*
* @note Call saveSettings() after calling this function to commit the change.
+ *
+ * @return true
*/
public function confirmEmail() {
$this->setEmailAuthenticationTimestamp( wfTimestampNow() );
* Get the permissions associated with a given list of groups
*
* @param $groups Array of Strings List of internal group names
+ * @param $ns int
+ *
* @return Array of Strings List of permission key names for given groups combined
*/
public static function getGroupPermissions( $groups, $ns = null ) {
/**
* Helper for User::getGroupPermissions
- * @param array $list
- * @param int $ns
+ * @param $list array
+ * @param $ns int
* @return array
*/
private static function extractRights( $list, $ns ) {
* Get all the groups who have a given permission
*
* @param $role String Role to check
+ * @param $ns int
+ *
+ *
* @return Array of Strings List of internal group names with the given permission
*/
public static function getGroupsWithPermission( $role, $ns = null ) {
* Make a new-style password hash
*
* @param $password String Plain-text password
- * @param $salt String Optional salt, may be random or the user ID.
+ * @param bool|string $salt Optional salt, may be random or the user ID.
+
* If unspecified or false, will generate one automatically
* @return String Password hash
*/
*
* @param $hash String Password hash
* @param $password String Plain-text password to compare
- * @param $userId String User ID for old-style password salt
- * @return Boolean:
+ * @param $userId String|bool User ID for old-style password salt
+ *
+ * @return Boolean
*/
public static function comparePasswords( $hash, $password, $userId = false ) {
$type = substr( $hash, 0, 3 );
return true;
}
+ /**
+ * @todo document
+ */
protected function loadOptions() {
$this->load();
if ( $this->mOptionsLoaded || !$this->getId() )
wfRunHooks( 'UserLoadOptions', array( $this, &$this->mOptions ) );
}
+ /**
+ * @todo document
+ */
protected function saveOptions() {
global $wgAllowPrefChange;
// Allow hooks to abort, for instance to save to a global profile.
// Reset options to default state before saving.
- if( !wfRunHooks( 'UserSaveOptions', array( $this, &$saveOptions ) ) )
+ if( !wfRunHooks( 'UserSaveOptions', array( $this, &$saveOptions ) ) ) {
return;
+ }
foreach( $saveOptions as $key => $value ) {
# Don't bother storing default values