/** @var Block */
private $mBlockedFromCreateAccount = false;
- /** @var integer User::READ_* constant bitfield used to load data */
+ /** @var int User::READ_* constant bitfield used to load data */
protected $queryFlagsUsed = self::READ_NORMAL;
public static $idCacheByName = [];
/**
* Load the user table data for this object from the source given by mFrom.
*
- * @param integer $flags User::READ_* constant bitfield
+ * @param int $flags User::READ_* constant bitfield
*/
public function load( $flags = self::READ_NORMAL ) {
global $wgFullyInitialised;
/**
* Load user table data, given mId has already been set.
- * @param integer $flags User::READ_* constant bitfield
+ * @param int $flags User::READ_* constant bitfield
* @return bool False if the ID does not exist, true otherwise
*/
public function loadFromId( $flags = self::READ_NORMAL ) {
/**
* @since 1.27
* @param string $wikiId
- * @param integer $userId
+ * @param int $userId
*/
public static function purge( $wikiId, $userId ) {
$cache = ObjectCache::getMainWANInstance();
/**
* Get database id given a user name
* @param string $name Username
- * @param integer $flags User::READ_* constant bitfield
+ * @param int $flags User::READ_* constant bitfield
* @return int|null The corresponding user's ID, or null if user is nonexistent
*/
public static function idFromName( $name, $flags = self::READ_NORMAL ) {
|| IP::isIPv6( $name );
}
+ /**
+ * Is the user an IP range?
+ *
+ * @since 1.30
+ * @return bool
+ */
+ public function isIPRange() {
+ return IP::isValidRange( $this->mName );
+ }
+
/**
* Is the input a valid username?
*
* Load user and user_group data from the database.
* $this->mId must be set, this is how the user is identified.
*
- * @param integer $flags User::READ_* constant bitfield
+ * @param int $flags User::READ_* constant bitfield
* @return bool True if the user exists, false if the user is anonymous
*/
public function loadFromDatabase( $flags = self::READ_LATEST ) {
/**
* Check if user is allowed to access a feature / make an action
*
- * @param string ... Permissions to test
+ * @param string $permissions,... Permissions to test
* @return bool True if user is allowed to perform *any* of the given actions
*/
public function isAllowedAny() {
/**
*
- * @param string ... Permissions to test
+ * @param string $permissions,... Permissions to test
* @return bool True if the user is allowed to perform *all* of the given actions
*/
public function isAllowedAll() {
* If e-notif e-mails are on, they will receive notification mails on
* the next change of the page if it's watched etc.
* @note If the user doesn't have 'editmywatchlist', this will do nothing.
- * @param Title $title Title of the article to look at
+ * @param Title &$title Title of the article to look at
* @param int $oldid The revision id being viewed. If not given or 0, latest revision is assumed.
*/
public function clearNotification( &$title, $oldid = 0 ) {
unset( $params['options'] );
}
$dbw = wfGetDB( DB_MASTER );
- $seqVal = $dbw->nextSequenceValue( 'user_user_id_seq' );
$noPass = PasswordFactory::newInvalidPassword()->toString();
$fields = [
- 'user_id' => $seqVal,
'user_name' => $name,
'user_password' => $noPass,
'user_newpassword' => $noPass,
$noPass = PasswordFactory::newInvalidPassword()->toString();
$dbw = wfGetDB( DB_MASTER );
- $seqVal = $dbw->nextSequenceValue( 'user_user_id_seq' );
$dbw->insert( 'user',
[
- 'user_id' => $seqVal,
'user_name' => $this->mName,
'user_password' => $noPass,
'user_newpassword' => $noPass,