* addresses like this, if we allowed accounts like this to be created
* new users could get the old edits of these anonymous users.
*
- * @param $name \type{\string}
- * @return \type{\bool}
+ * @param $name \type{\string} String to match
+ * @return \type{\bool} True or false
*/
static function isIP( $name ) {
return preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.(?:xxx|\d{1,3})$/',$name) || IP::isIPv6($name);
* is longer than the maximum allowed username size or doesn't begin with
* a capital letter.
*
- * @param $name \type{\string}
- * @return \type{\bool}
+ * @param $name \type{\string} String to match
+ * @return \type{\bool} True or false
*/
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 $name \type{\string}
- * @return \type{\bool}
+ * @param $name \type{\string} String to match
+ * @return \type{\bool} True or false
*/
static function isUsableName( $name ) {
global $wgReservedUsernames;
* rather than in isValidUserName() to avoid disrupting
* existing accounts.
*
- * @param $name \type{\string}
- * @return \type{\bool}
+ * @param $name \type{\string} String to match
+ * @return \type{\bool} True or false
*/
static function isCreatableName( $name ) {
return
* Is the input a valid password for this user?
*
* @param $password \type{\string} Desired password
- * @return \type{\bool}
+ * @return \type{\bool} True or false
*/
function isValidPassword( $password ) {
global $wgMinimalPasswordLength, $wgContLang;
* @todo Check for RFC 2822 compilance (bug 959)
*
* @param $addr \type{\string} E-mail address
- * @return \type{\bool}
+ * @return \type{\bool} True or false
*/
public static function isValidEmailAddr( $addr ) {
$result = null;
* Return a random password. Sourced from mt_rand, so it's not particularly secure.
* @todo hash random numbers to improve security, like generateToken()
*
- * @return \type{\string}
+ * @return \type{\string} New random password
*/
static function randomPassword() {
global $wgMinimalPasswordLength;
* Get a given default option value.
*
* @param $opt \type{\string} Name of option to retrieve
- * @return \type{\string}
+ * @return \type{\string} Default option value
*/
public static function getDefaultOption( $opt ) {
$defOpts = self::getDefaultOptions();
/**
* Get a list of user toggle names
- * @return \arrayof{\string}
+ * @return \arrayof{\string} Array of user toggle names
*/
static function getToggles() {
global $wgContLang;
* Whether the given IP is in the SORBS blacklist.
*
* @param $ip \type{\string} IP to check
- * @return \type{\bool}
+ * @return \type{\bool} True if blacklisted
*/
function inSorbsBlacklist( $ip ) {
global $wgEnableSorbs, $wgSorbsUrl;
*
* @param $ip \type{\string} IP to check
* @param $base \type{\string} URL of the DNS blacklist
- * @return \type{\bool}
+ * @return \type{\bool} True if blacklisted
*/
function inDnsBlacklist( $ip, $base ) {
wfProfileIn( __METHOD__ );
/**
* Is this user subject to rate limiting?
*
- * @return \type{\bool}
+ * @return \type{\bool} True if rate limited
*/
public function isPingLimitable() {
global $wgRateLimitsExcludedGroups;
/**
* Get the user name, or the IP of an anonymous user
- * @return \type{\string}
+ * @return \type{\string} User's name or IP address
*/
function getName() {
if ( !$this->mDataLoaded && $this->mFrom == 'name' ) {
/**
* Get the user's name escaped by underscores.
- * @return \type{\string}
+ * @return \type{\string} Username escaped by underscores
*/
function getTitleKey() {
return str_replace( ' ', '_', $this->getName() );
/**
* Get the user's current token.
- * @return \type{\string}
+ * @return \type{\string} Token
*/
function getToken() {
$this->load();
/**
* Has password reminder email been sent within the last
* $wgPasswordReminderResendTime hours?
- * @return \type{\bool}
+ * @return \type{\bool} True or false
*/
function isPasswordReminderThrottled() {
global $wgPasswordReminderResendTime;
/**
* Get the user's e-mail address
- * @return \type{\string}
+ * @return \type{\string} User's e-mail address
*/
function getEmail() {
$this->load();
/**
* Get the user's real name
- * @return \type{\string}
+ * @return \type{\string} User's real name
*/
function getRealName() {
$this->load();
/**
* Get the user's preferred date format.
- * @return \type{\string}
+ * @return \type{\string} User's preferred date format
*/
function getDatePreference() {
// Important migration for old data rows
/**
* Get the permissions this user has.
- * @return \arrayof{\string}
+ * @return \arrayof{\string} Array of permission names
*/
function getRights() {
if ( is_null( $this->mRights ) ) {
/**
* Get the list of explicit group memberships this user has.
* The implicit * and user groups are not included.
- * @return \arrayof{\string}
+ * @return \arrayof{\string} Array of internal group names
*/
function getGroups() {
$this->load();
* 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 $recache \type{\bool} Whether to avoid the cache
- * @return \arrayof{\string}
+ * @return \arrayof{\string} Array of internal group names
*/
function getEffectiveGroups( $recache = false ) {
if ( $recache || is_null( $this->mEffectiveGroups ) ) {
/**
* Get the user's edit count.
- * @return \type{\int}
+ * @return \type{\int} User's edit count
*/
function getEditCount() {
if ($this->mId) {
/**
* Get whether the user is logged in
- * @return \type{\bool}
+ * @return \type{\bool} True or false
*/
function isLoggedIn() {
return $this->getID() != 0;
/**
* Get whether the user is anonymous
- * @return \type{\bool}
+ * @return \type{\bool} True or false
*/
function isAnon() {
return !$this->isLoggedIn();
/**
* Get whether the user is a bot
- * @return \type{\bool}
+ * @return \type{\bool} True or false
* @deprecated
*/
function isBot() {
/**
* Check whether to enable recent changes patrol features for this user
- * @return \type{\bool}
+ * @return \type{\bool} True or false
*/
public function useRCPatrol() {
global $wgUseRCPatrol;
/**
* Check whether to enable new pages patrol features for this user
- * @return \type{\bool}
+ * @return \type{\bool} True or false
*/
public function useNPPatrol() {
global $wgUseRCPatrol, $wgUseNPPatrol;
/**
* Get the current skin, loading it if required
- * @return \type{Skin}
+ * @return \type{Skin} Current skin
* @todo FIXME : need to check the old failback system [AV]
*/
function &getSkin() {
* which will give them a chance to modify this key based on their own
* settings.
*
- * @return \type{\string}
+ * @return \type{\string} Page rendering hash
*/
function getPageRenderingHash() {
global $wgContLang, $wgUseDynamicDates, $wgLang;
/**
* Get whether the user is explicitly blocked from account creation.
- * @return \type{\bool}
+ * @return \type{\bool} True if blocked
*/
function isBlockedFromCreateAccount() {
$this->getBlockedStatus();
/**
* Get whether the user is blocked from using Special:Emailuser.
- * @return \type{\bool}
+ * @return \type{\bool} True if blocked
*/
function isBlockedFromEmailuser() {
$this->getBlockedStatus();
/**
* Get whether the user is allowed to create an account.
- * @return \type{\bool}
+ * @return \type{\bool} True if allowed
*/
function isAllowedToCreateAccount() {
return $this->isAllowed( 'createaccount' ) && !$this->isBlockedFromCreateAccount();
/**
* Get this user's personal page title.
*
- * @return \type{Title}
+ * @return \type{Title} User's personal page title
*/
function getUserPage() {
return Title::makeTitle( NS_USER, $this->getName() );
/**
* Get this user's talk page title.
*
- * @return \type{Title}
+ * @return \type{Title} User's talk page title
*/
function getTalkPage() {
$title = $this->getUserPage();
/**
* Get the maximum valid user ID.
- * @return \type{\int}
+ * @return \type{\int} %User ID
* @static
*/
function getMaxID() {
/**
* Check if the given clear-text password matches the temporary password
* sent by e-mail for password reset operations.
- * @return \type{\bool}
+ * @return \type{\bool} True if matches, false otherwise
*/
function checkTemporaryPassword( $plaintext ) {
return self::comparePasswords( $this->mNewpassword, $plaintext, $this->getId() );
* @param $subject \type{\string} Message subject
* @param $body \type{\string} Message body
* @param $from \type{\string} Optional From address; if unspecified, default $wgPasswordSender will be used
- * @param $replyto \type{\string}
+ * @param $replyto \type{\string} Reply-to address
* @return \twotypes{\bool,WikiError} True on success, a WikiError object on failure
*/
function sendMail( $subject, $body, $from = null, $replyto = null ) {
* this change to the database.
*
* @param[out] &$expiration \type{\mixed} Accepts the expiration time
- * @return \type{\string}
+ * @return \type{\string} New token
* @private
*/
function confirmationToken( &$expiration ) {
/**
* Return a URL the user can use to confirm their email address.
* @param $token \type{\string} Accepts the email confirmation token
- * @return \type{\string}
+ * @return \type{\string} New token URL
* @private
*/
function confirmationTokenUrl( $token ) {
}
/**
* Return a URL the user can use to invalidate their email address.
+ *
* @param $token \type{\string} Accepts the email confirmation token
- * @return \type{\string}
+ * @return \type{\string} New token URL
* @private
*/
function invalidationTokenUrl( $token ) {
/**
* Is this user allowed to send e-mails within limits of current
* site configuration?
- * @return \type{\bool}
+ * @return \type{\bool} True if allowed
*/
function canSendEmail() {
$canSend = $this->isEmailConfirmed();
/**
* Is this user allowed to receive e-mails within limits of current
* site configuration?
- * @return \type{\bool}
+ * @return \type{\bool} True if allowed
*/
function canReceiveEmail() {
return $this->isEmailConfirmed() && !$this->getOption( 'disablemail' );
* confirmed their address by returning a code or using a password
* sent to the address from the wiki.
*
- * @return \type{\bool}
+ * @return \type{\bool} True if confirmed
*/
function isEmailConfirmed() {
global $wgEmailAuthentication;
/**
* Check whether there is an outstanding request for e-mail confirmation.
- * @return \type{\bool}
+ * @return \type{\bool} True if pending
*/
function isEmailConfirmationPending() {
global $wgEmailAuthentication;
* Get the localized descriptive name for a group, if it exists
*
* @param $group \type{\string} Internal group name
- * @return \type{\string}
+ * @return \type{\string} Localized descriptive group name
*/
static function getGroupName( $group ) {
global $wgMessageCache;
* Get the localized descriptive name for a member of a group, if it exists
*
* @param $group \type{\string} Internal group name
- * @return \type{\string}
+ * @return \type{\string} Localized name for group member
*/
static function getGroupMember( $group ) {
global $wgMessageCache;
* 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.
- * @return \arrayof{\string}
+ * @return \arrayof{\string} Array of internal group names
*/
static function getAllGroups() {
global $wgGroupPermissions;
/**
* Get a list of all available permissions.
- * @return \arrayof{\string}
+ * @return \arrayof{\string} Array of permission names
*/
static function getAllRights() {
if ( self::$mAllRights === false ) {
/**
* Get a list of implicit groups
- * @return \arrayof{\string}
+ * @return \arrayof{\string} Array of internal group names
*/
public static function getImplicitGroups() {
global $wgImplicitGroups;
* Get the description of a given right
*
* @param $right \type{\string} Right to query
- * @return \type{\string}
+ * @return \type{\string} Localized description of the right
*/
static function getRightDescription( $right ) {
global $wgMessageCache;
* @param $hash \type{\string} Password hash
* @param $password \type{\string} Plain-text password to compare
* @param $userId \type{\string} %User ID for old-style password salt
- * @return \type{\bool}
+ * @return \type{\bool} True if matches, false otherwise
*/
static function comparePasswords( $hash, $password, $userId = false ) {
$m = false;