MediaWiki  1.28.0
Block Class Reference
Collaboration diagram for Block:

Public Member Functions

 __construct ($options=[])
 Create a new block with specified parameters on a user, IP or IP range. More...
 
 delete ()
 Delete the row from the IP blocks table. More...
 
 deleteIfExpired ()
 Check if a block has expired. More...
 
 doAutoblock ($autoblockIP)
 Autoblocks the given IP, referring to this Block. More...
 
 equals (Block $block)
 Check if two blocks are effectively equal. More...
 
 fromMaster ($x=null)
 Get/set a flag determining whether the master is used for reads. More...
 
 getBlocker ()
 Get the user who implemented this block. More...
 
 getBy ()
 Get the user id of the blocking sysop. More...
 
 getByName ()
 Get the username of the blocking sysop. More...
 
 getExpiry ()
 
 getId ()
 Get the block ID. More...
 
 getPermissionsError (IContextSource $context)
 Get the key and parameters for the corresponding error message. More...
 
 getRangeEnd ()
 Get the IP address at the end of the range in Hex form. More...
 
 getRangeStart ()
 Get the IP address at the start of the range in Hex form. More...
 
 getRedactedName ()
 Get the block name, but with autoblocked IPs hidden as per standard privacy policy. More...
 
 getTarget ()
 Get the target for this particular Block. More...
 
 getTargetAndType ()
 Get the target and target type for this particular Block. More...
 
 getType ()
 Get the type of target for this particular block. More...
 
 insert ($dbw=null)
 Insert a block into the block table. More...
 
 isAutoblocking ($x=null)
 
 isExpired ()
 Has the block expired? More...
 
 isHardblock ($x=null)
 Get/set whether the Block is a hardblock (affects logged-in users on a given IP/range) More...
 
 isValid ()
 Is the block address valid (i.e. More...
 
 prevents ($action, $x=null)
 Get/set whether the Block prevents a given action. More...
 
 setBlocker ($user)
 Set the user who implemented (or will implement) this block. More...
 
 setTarget ($target)
 Set the target for this block, and update $this->type accordingly. More...
 
 update ()
 Update a block in the DB with new parameters. More...
 
 updateTimestamp ()
 Update the timestamp on autoblocks. More...
 

Static Public Member Functions

static chooseBlock (array $blocks, array $ipChain)
 From a list of multiple blocks, find the most exact and strongest Block. More...
 
static getAutoblockExpiry ($timestamp)
 Get a timestamp of the expiry for autoblocks. More...
 
static getBlocksForIPList (array $ipChain, $isAnon, $fromMaster=false)
 Get all blocks that match any IP from an array of IP addresses. More...
 
static getRangeCond ($start, $end=null)
 Get a set of SQL conditions which will select rangeblocks encompassing a given range. More...
 
static isWhitelistedFromAutoblocks ($ip)
 Checks whether a given IP is on the autoblock whitelist. More...
 
static newFromID ($id)
 Load a blocked user from their block id. More...
 
static newFromRow ($row)
 Create a new Block object from a database row. More...
 
static newFromTarget ($specificTarget, $vagueTarget=null, $fromMaster=false)
 Given a target and the target's type, get an existing Block object if possible. More...
 
static parseTarget ($target)
 From an existing Block, get the target and the type of target. More...
 
static purgeExpired ()
 Purge expired blocks from the ipblocks table. More...
 
static selectFields ()
 Return the list of ipblocks fields that should be selected to create a new block. More...
 

Public Attributes

bool $mAuto
 
string $mExpiry
 
bool $mHideName
 
int $mParentBlockId
 
string $mReason
 
string $mTimestamp
 
const TYPE_AUTO = 4
 
const TYPE_ID = 5
 
const TYPE_IP = 2
 
const TYPE_RANGE = 3
 
const TYPE_USER = 1
 

Protected Member Functions

 doRetroactiveAutoblock ()
 Retroactively autoblocks the last IP used by the user (if it is a user) blocked by this Block. More...
 
 getAutoblockUpdateArray ()
 
 getDatabaseArray ($db=null)
 Get an array suitable for passing to $dbw->insert() or $dbw->update() More...
 
 initFromRow ($row)
 Given a database row from the ipblocks table, initialize member variables. More...
 
 newLoad ($vagueTarget=null)
 Load a block from the database which affects the already-set $this->target: 1) A block directly on the given user or IP 2) A rangeblock encompassing the given IP (smallest first) 3) An autoblock on the given IP. More...
 

Static Protected Member Functions

static defaultRetroactiveAutoblock (Block $block, array &$blockIds)
 Retroactively autoblocks the last IP used by the user (if it is a user) blocked by this Block. More...
 
static getIpFragment ($hex)
 Get the component of an IP address which is certain to be the same between an IP address and a rangeblock containing that IP address. More...
 

Protected Attributes

User $blocker
 
int $forcedTargetID
 Hack for foreign blocking (CentralAuth) More...
 
bool $isAutoblocking
 
bool $isHardblock
 
bool $mBlockEmail
 
bool $mCreateAccount
 
bool $mDisableUsertalk
 
bool $mFromMaster
 
int $mId
 
User string $target
 
int $type
 Block::TYPE_ constant. More...
 

Detailed Description

Definition at line 25 of file Block.php.

Constructor & Destructor Documentation

Block::__construct (   $options = [])

Create a new block with specified parameters on a user, IP or IP range.

Parameters
array$optionsParameters of the block: address string|User Target user name, User object, IP address or IP range user int Override target user ID (for foreign users) by int User ID of the blocker reason string Reason of the block timestamp string The time at which the block comes into effect auto bool Is this an automatic block? expiry string Timestamp of expiration of the block or 'infinity' anonOnly bool Only disallow anonymous actions createAccount bool Disallow creation of new accounts enableAutoblock bool Enable automatic blocking hideName bool Hide the target user name blockEmail bool Disallow sending emails allowUsertalk bool Allow the target to edit its own talk page byText string Username of the blocker (for foreign users)
Since
1.26 accepts $options array instead of individual parameters; order of parameters above reflects the original order

Definition at line 106 of file Block.php.

References $options, DB_REPLICA, isAutoblocking(), isHardblock(), User\newFromId(), prevents(), setBlocker(), setTarget(), TS_MW, wfDeprecated(), wfGetDB(), and wfTimestamp().

Member Function Documentation

static Block::chooseBlock ( array  $blocks,
array  $ipChain 
)
static

From a list of multiple blocks, find the most exact and strongest Block.

The logic for finding the "best" block is:

  • Blocks that match the block's target IP are preferred over ones in a range
  • Hardblocks are chosen over softblocks that prevent account creation
  • Softblocks that prevent account creation are chosen over other softblocks
  • Other softblocks are chosen over autoblocks
  • If there are multiple exact or range blocks at the same level, the one chosen is random This should be used when $blocks where retrieved from the user's IP address and $ipChain is populated from the same IP address information.
Parameters
array$blocksArray of Block objects
array$ipChainList of IPs (strings). This is used to determine how "close" a block is to the server, and if a block matches exactly, or is in a range. The order is furthest from the server to nearest e.g., (Browser, proxy1, proxy2, local-squid, ...)
Exceptions
MWException
Returns
Block|null The "best" block from the list

Definition at line 1203 of file Block.php.

References as, false, isHardblock(), prevents(), and IP\toHex().

Referenced by User\getBlockedStatus(), and BlockTest\testBlocksOnXff().

static Block::defaultRetroactiveAutoblock ( Block  $block,
array $blockIds 
)
staticprotected

Retroactively autoblocks the last IP used by the user (if it is a user) blocked by this Block.

This will use the recentchanges table.

Parameters
Block$block
array&$blockIds

Definition at line 651 of file Block.php.

References $dbr, $options, $res, as, DB_REPLICA, doAutoblock(), getTarget(), global, string, wfDebug(), and wfGetDB().

Block::delete ( )

Delete the row from the IP blocks table.

Exceptions
MWException
Returns
bool

Definition at line 438 of file Block.php.

References DB_MASTER, getId(), wfGetDB(), and wfReadOnly().

Block::deleteIfExpired ( )

Check if a block has expired.

Delete it if it is.

Returns
bool

Definition at line 808 of file Block.php.

References isExpired(), and wfDebug().

Block::doAutoblock (   $autoblockIP)

Autoblocks the given IP, referring to this Block.

Parameters
string$autoblockIPThe IP to autoblock.
Returns
int|bool Block ID if an autoblock was inserted, false if not.

Definition at line 738 of file Block.php.

References $mHideName, $mId, $status, $timestamp, getAutoblockExpiry(), getBlocker(), getTarget(), isAutoblocking(), newFromTarget(), prevents(), Hooks\run(), wfDebug(), wfMessage(), and wfTimestampNow().

Referenced by defaultRetroactiveAutoblock().

Block::doRetroactiveAutoblock ( )
protected

Retroactively autoblocks the last IP used by the user (if it is a user) blocked by this Block.

Returns
array Block IDs of retroactive autoblocks made

Definition at line 628 of file Block.php.

References getTarget(), getType(), isAutoblocking(), Hooks\run(), and wfDebug().

Referenced by insert(), and update().

Block::equals ( Block  $block)

Check if two blocks are effectively equal.

Doesn't check irrelevant things like the blocking user or the block timestamp, only things which affect the blocked user

Parameters
Block$block
Returns
bool

Definition at line 221 of file Block.php.

References isAutoblocking(), isHardblock(), and prevents().

Block::fromMaster (   $x = null)

Get/set a flag determining whether the master is used for reads.

Parameters
bool | null$x
Returns
bool

Definition at line 943 of file Block.php.

References wfSetVar().

static Block::getAutoblockExpiry (   $timestamp)
static

Get a timestamp of the expiry for autoblocks.

Parameters
string | int$timestamp
Returns
string

Definition at line 1035 of file Block.php.

References $timestamp, global, TS_MW, TS_UNIX, and wfTimestamp().

Referenced by doAutoblock(), and updateTimestamp().

Block::getAutoblockUpdateArray ( )
protected
Returns
array

Definition at line 611 of file Block.php.

References $mReason, getBy(), getByName(), and prevents().

Referenced by update().

Block::getBlocker ( )

Get the user who implemented this block.

Returns
User|string Local User object or string for a foreign user

Definition at line 1408 of file Block.php.

References $blocker.

Referenced by doAutoblock(), getBy(), getByName(), getPermissionsError(), and BlockTest\testCrappyCrossWikiBlocks().

static Block::getBlocksForIPList ( array  $ipChain,
  $isAnon,
  $fromMaster = false 
)
static

Get all blocks that match any IP from an array of IP addresses.

Parameters
array$ipChainList of IPs (strings), usually retrieved from the X-Forwarded-For header of the request
bool$isAnonExclude anonymous-only blocks if false
bool$fromMasterWhether to query the master or replica DB
Returns
array Array of Blocks
Since
1.22

Definition at line 1122 of file Block.php.

References as, DB_MASTER, DB_REPLICA, IP\isValid(), LIST_OR, selectFields(), IP\toHex(), and wfGetDB().

Referenced by User\getBlockedStatus(), and BlockTest\testBlocksOnXff().

Block::getBy ( )

Get the user id of the blocking sysop.

Returns
int (0 for foreign users)

Definition at line 910 of file Block.php.

References getBlocker(), and User\getId().

Referenced by getAutoblockUpdateArray(), ApiQueryUserInfo\getBlockInfo(), getDatabaseArray(), and BlockTest\testCrappyCrossWikiBlocks().

Block::getByName ( )

Get the username of the blocking sysop.

Returns
string

Definition at line 922 of file Block.php.

References getBlocker(), User\getName(), and string.

Referenced by getAutoblockUpdateArray(), ApiQueryUserInfo\getBlockInfo(), getDatabaseArray(), getPermissionsError(), and BlockTest\testCrappyCrossWikiBlocks().

Block::getDatabaseArray (   $db = null)
protected

Get an array suitable for passing to $dbw->insert() or $dbw->update()

Parameters
IDatabase$db
Returns
array

Definition at line 573 of file Block.php.

References $forcedTargetID, $mAuto, $mParentBlockId, $mReason, DB_REPLICA, getBy(), getByName(), getRangeEnd(), getRangeStart(), isAutoblocking(), isHardblock(), prevents(), string, and wfGetDB().

Referenced by insert(), and update().

Block::getExpiry ( )
Since
1.19
Returns
mixed|string

Definition at line 1392 of file Block.php.

References $mExpiry.

Referenced by ApiQueryUserInfo\getBlockInfo().

Block::getId ( )

Get the block ID.

Returns
int

Definition at line 933 of file Block.php.

References $mId.

Referenced by delete(), ApiQueryUserInfo\getBlockInfo(), getPermissionsError(), update(), and updateTimestamp().

static Block::getIpFragment (   $hex)
staticprotected

Get the component of an IP address which is certain to be the same between an IP address and a rangeblock containing that IP address.

Parameters
string$hexHexadecimal IP representation
Returns
string

Definition at line 381 of file Block.php.

References global.

Block::getPermissionsError ( IContextSource  $context)

Get the key and parameters for the corresponding error message.

Since
1.22
Parameters
IContextSource$context
Returns
array

Definition at line 1427 of file Block.php.

References $blocker, $lang, $link, $mReason, getBlocker(), getByName(), getId(), IContextSource\getLanguage(), IContextSource\getRequest(), getTarget(), IContextSource\getUser(), User\getUserPage(), IContextSource\msg(), and string.

Referenced by UserBlockedError\__construct().

static Block::getRangeCond (   $start,
  $end = null 
)
static

Get a set of SQL conditions which will select rangeblocks encompassing a given range.

Parameters
string$startHexadecimal IP representation
string$endHexadecimal IP representation, or null to use $start = $end
Returns
string

Definition at line 348 of file Block.php.

References $dbr, DB_REPLICA, LIST_AND, and wfGetDB().

Referenced by SpecialBlockList\getBlockListPager().

Block::getRangeEnd ( )

Get the IP address at the end of the range in Hex form.

Exceptions
MWException
Returns
string IP in Hex form

Definition at line 891 of file Block.php.

References list, IP\parseRange(), IP\toHex(), and type.

Referenced by getDatabaseArray().

Block::getRangeStart ( )

Get the IP address at the start of the range in Hex form.

Exceptions
MWException
Returns
string IP in Hex form

Definition at line 872 of file Block.php.

References list, IP\parseRange(), IP\toHex(), and type.

Referenced by getDatabaseArray().

Block::getRedactedName ( )

Get the block name, but with autoblocked IPs hidden as per standard privacy policy.

Returns
string Text is escaped

Definition at line 1017 of file Block.php.

References getTarget(), Html\rawElement(), and wfMessage().

Block::getTarget ( )

Get the target for this particular Block.

Note that for autoblocks, this returns the unredacted name; frontend functions need to call $block->getRedactedName() in this situation.

Returns
User|string

Definition at line 1383 of file Block.php.

References $target.

Referenced by defaultRetroactiveAutoblock(), doAutoblock(), doRetroactiveAutoblock(), getPermissionsError(), getRedactedName(), getTargetAndType(), isValid(), BlockTest\testCrappyCrossWikiBlocks(), and BlockTest\testDeprecatedConstructor().

Block::getTargetAndType ( )

Get the target and target type for this particular Block.

Note that for autoblocks, this returns the unredacted name; frontend functions need to call $block->getRedactedName() in this situation.

Returns
array( User|String, Block::TYPE_ constant )
Todo:
FIXME: This should be an integral part of the Block member variables

Definition at line 1373 of file Block.php.

References getTarget(), and getType().

Block::getType ( )

Get the type of target for this particular block.

Returns
int Block::TYPE_ constant, will never be TYPE_ID

Definition at line 1360 of file Block.php.

References $type.

Referenced by ApiBase\dieBlocked(), doRetroactiveAutoblock(), getTargetAndType(), isAutoblocking(), and isHardblock().

Block::initFromRow (   $row)
protected

Given a database row from the ipblocks table, initialize member variables.

Parameters
stdClass$rowA row from the ipblocks table

Definition at line 395 of file Block.php.

References DB_REPLICA, isAutoblocking(), isHardblock(), User\newFromId(), prevents(), setBlocker(), setTarget(), TS_MW, wfGetDB(), and wfTimestamp().

Referenced by newFromRow(), and newLoad().

Block::insert (   $dbw = null)

Insert a block into the block table.

Will fail if there is a conflicting block (same name and options) already in the database.

Parameters
IDatabase$dbwIf you have one available
Returns
bool|array False on failure, assoc array on success: ('id' => block ID, 'autoIds' => array of autoblock IDs)

Definition at line 462 of file Block.php.

References $mId, DB_MASTER, doRetroactiveAutoblock(), getDatabaseArray(), global, purgeExpired(), wfDebug(), and wfGetDB().

Referenced by LocalIdLookupTest\addDBData(), BlockTest\addXffBlocks(), BlockTest\testBlockedUserCanNotCreateAccount(), BlockTest\testCrappyCrossWikiBlocks(), and BlockTest\testDeprecatedConstructor().

Block::isAutoblocking (   $x = null)
Parameters
null | bool$x
Returns
bool

Definition at line 965 of file Block.php.

References getType(), and wfSetVar().

Referenced by __construct(), BlockTest\addXffBlocks(), doAutoblock(), doRetroactiveAutoblock(), equals(), getDatabaseArray(), initFromRow(), and update().

Block::isExpired ( )

Has the block expired?

Returns
bool

Definition at line 826 of file Block.php.

References $mExpiry, $timestamp, wfDebug(), and wfTimestampNow().

Referenced by deleteIfExpired().

Block::isHardblock (   $x = null)

Get/set whether the Block is a hardblock (affects logged-in users on a given IP/range)

Parameters
bool | null$x
Returns
bool

Definition at line 952 of file Block.php.

References $isHardblock, getType(), and wfSetVar().

Referenced by __construct(), BlockTest\addXffBlocks(), chooseBlock(), equals(), getDatabaseArray(), and initFromRow().

Block::isValid ( )

Is the block address valid (i.e.

not a null string?)

Returns
bool

Definition at line 841 of file Block.php.

References getTarget().

static Block::isWhitelistedFromAutoblocks (   $ip)
static

Checks whether a given IP is on the autoblock whitelist.

TODO: this probably belongs somewhere else, but not sure where...

Parameters
string$ipThe IP to check
Returns
bool

Definition at line 692 of file Block.php.

References $cache, $line, $lines, array(), as, DB_REPLICA, Database\getCacheSetOptions(), IP\isInRange(), plain, wfDebug(), wfGetDB(), wfMemcKey(), and wfMessage().

static Block::newFromID (   $id)
static

Load a blocked user from their block id.

Parameters
int$idBlock id to search for
Returns
Block|null

Definition at line 173 of file Block.php.

References $dbr, $res, DB_REPLICA, and wfGetDB().

Referenced by newFromTarget(), BlockTest\testCrappyCrossWikiBlocks(), and BlockTest\testINewFromIDReturnsCorrectBlock().

static Block::newFromRow (   $row)
static

Create a new Block object from a database row.

Parameters
stdClass$rowRow from the ipblocks table
Returns
Block

Definition at line 426 of file Block.php.

References initFromRow().

Referenced by CleanupBlocks\execute().

static Block::newFromTarget (   $specificTarget,
  $vagueTarget = null,
  $fromMaster = false 
)
static

Given a target and the target's type, get an existing Block object if possible.

Parameters
string | User | int$specificTargetA block target, which may be one of several types:
  • A user to block, in which case $target will be a User
  • An IP to block, in which case $target will be a User generated by using User::newFromName( $ip, false ) to turn off name validation
  • An IP range, in which case $target will be a String "123.123.123.123/18" etc
  • The ID of an existing block, in the format "#12345" (since pure numbers are valid usernames Calling this with a user, IP address or range will not select autoblocks, and will only select a block where the targets match exactly (so looking for blocks on 1.2.3.4 will not select 1.2.0.0/16 or even 1.2.3.4/32)
string | User | int$vagueTargetAs above, but we will search for any block which affects that target (so for an IP address, get ranges containing that IP; and also get any relevant autoblocks). Leave empty or blank to skip IP-based lookups.
bool$fromMasterWhether to use the DB_MASTER database
Returns
Block|null (null if no relevant block could be found). The target and type of the returned Block will refer to the actual block which was found, which might not be the same as the target you gave if you used $vagueTarget!

Definition at line 1082 of file Block.php.

References list, newFromID(), TYPE_AUTO, TYPE_ID, TYPE_IP, TYPE_RANGE, and TYPE_USER.

Referenced by BlockTest\addDBData(), SpecialContributions\contributionsSub(), doAutoblock(), ApiUnblock\execute(), ApiBlock\execute(), SpecialUnblock\execute(), User\getBlockedStatus(), MediaWiki\Auth\CheckBlocksSecondaryAuthenticationProviderTest\getBlockedUser(), Article\getRobotPolicy(), DeletedContributionsPage\getSubTitle(), User\isBlockedFromCreateAccount(), SpecialBlock\maybeAlterFormDefaults(), SpecialBlock\processForm(), SpecialUnblock\processUnblock(), EditPage\showIntro(), Article\showMissingArticle(), User\spreadBlock(), BlockTest\testBlockedUserCanNotCreateAccount(), BlockTest\testBug29116NewFromTargetWithEmptyIp(), MediaWiki\Auth\AuthManagerTest\testCheckAccountCreatePermissions(), BlockTest\testCrappyCrossWikiBlocks(), BlockTest\testDeprecatedConstructor(), BlockTest\testINewFromTargetReturnsCorrectBlock(), and ApiBlockTest\testMakeNormalBlock().

Block::newLoad (   $vagueTarget = null)
protected

Load a block from the database which affects the already-set $this->target: 1) A block directly on the given user or IP 2) A rangeblock encompassing the given IP (smallest first) 3) An autoblock on the given IP.

Parameters
User | string$vagueTargetAlso search for blocks affecting this target. Doesn't make any sense to use TYPE_AUTO / TYPE_ID here. Leave blank to skip IP lookups.
Exceptions
MWException
Returns
bool Whether a relevant block was found

Definition at line 247 of file Block.php.

References $res, as, DB_MASTER, DB_REPLICA, initFromRow(), list, LIST_OR, IP\parseRange(), prevents(), string, IP\toHex(), type, and wfGetDB().

static Block::parseTarget (   $target)
static

From an existing Block, get the target and the type of target.

Note that, except for null, it is always safe to treat the target as a string; for User objects this will return User::__toString() which in turn gives User::getName().

Parameters
string | int | User | null$target
Returns
array( User|String|null, Block::TYPE_ constant|null )

Definition at line 1305 of file Block.php.

References $target, IP\isValid(), IP\isValidBlock(), User\newFromName(), IP\sanitizeIP(), IP\sanitizeRange(), TYPE_AUTO, TYPE_IP, TYPE_RANGE, and TYPE_USER.

Referenced by BlockListPager\formatValue(), SpecialBlockList\getBlockListPager(), SpecialBlock\getTargetAndType(), and SpecialBlock\setParameter().

Block::prevents (   $action,
  $x = null 
)

Get/set whether the Block prevents a given action.

Parameters
string$actionAction to check
bool | null$xValue for set, or null to just get value
Returns
bool|null Null for unrecognized rights.

Definition at line 982 of file Block.php.

References $res, global, User, and wfSetVar().

Referenced by __construct(), BlockTest\addXffBlocks(), chooseBlock(), doAutoblock(), equals(), getAutoblockUpdateArray(), getDatabaseArray(), initFromRow(), User\isBlockedFromCreateAccount(), newLoad(), BlockTest\testBlockedUserCanNotCreateAccount(), and BlockTest\testDeprecatedConstructor().

static Block::purgeExpired ( )
static

Purge expired blocks from the ipblocks table.

Definition at line 1044 of file Block.php.

References $fname, IDatabase\addQuotes(), DeferredUpdates\addUpdate(), DB_MASTER, IDatabase\delete(), IDatabase\timestamp(), wfGetDB(), and wfReadOnly().

Referenced by insert().

static Block::selectFields ( )
static

Return the list of ipblocks fields that should be selected to create a new block.

Returns
array

Definition at line 193 of file Block.php.

Referenced by getBlocksForIPList().

Block::setBlocker (   $user)

Set the user who implemented (or will implement) this block.

Parameters
User | string$userLocal User object or username string for foreign users

Definition at line 1416 of file Block.php.

References $user.

Referenced by __construct(), BlockTest\addXffBlocks(), User\getBlockedStatus(), and initFromRow().

Block::setTarget (   $target)

Set the target for this block, and update $this->type accordingly.

Parameters
mixed$target

Definition at line 1400 of file Block.php.

References list, and type.

Referenced by __construct(), BlockTest\addXffBlocks(), User\getGlobalBlock(), and initFromRow().

Block::update ( )

Update a block in the DB with new parameters.

The ID field needs to be loaded first.

Returns
bool|array False on failure, array on success: ('id' => block ID, 'autoIds' => array of autoblock IDs)

Definition at line 526 of file Block.php.

References $mId, DB_MASTER, doRetroactiveAutoblock(), getAutoblockUpdateArray(), getDatabaseArray(), getId(), isAutoblocking(), wfDebug(), and wfGetDB().

Block::updateTimestamp ( )

Update the timestamp on autoblocks.

Definition at line 848 of file Block.php.

References DB_MASTER, getAutoblockExpiry(), getId(), wfGetDB(), and wfTimestamp().

Member Data Documentation

User Block::$blocker
protected

Definition at line 69 of file Block.php.

Referenced by getBlocker(), and getPermissionsError().

int Block::$forcedTargetID
protected

Hack for foreign blocking (CentralAuth)

Definition at line 63 of file Block.php.

Referenced by getDatabaseArray().

bool Block::$isAutoblocking
protected

Definition at line 75 of file Block.php.

bool Block::$isHardblock
protected

Definition at line 72 of file Block.php.

Referenced by isHardblock().

bool Block::$mAuto

Definition at line 33 of file Block.php.

Referenced by getDatabaseArray().

bool Block::$mBlockEmail
protected

Definition at line 51 of file Block.php.

bool Block::$mCreateAccount
protected

Definition at line 57 of file Block.php.

bool Block::$mDisableUsertalk
protected

Definition at line 54 of file Block.php.

string Block::$mExpiry

Definition at line 36 of file Block.php.

Referenced by getExpiry(), and isExpired().

bool Block::$mFromMaster
protected

Definition at line 48 of file Block.php.

bool Block::$mHideName

Definition at line 39 of file Block.php.

Referenced by doAutoblock().

int Block::$mId
protected

Definition at line 45 of file Block.php.

Referenced by doAutoblock(), getId(), insert(), and update().

int Block::$mParentBlockId

Definition at line 42 of file Block.php.

Referenced by getDatabaseArray().

string Block::$mReason

Definition at line 27 of file Block.php.

Referenced by getAutoblockUpdateArray(), getDatabaseArray(), and getPermissionsError().

string Block::$mTimestamp

Definition at line 30 of file Block.php.

User string Block::$target
protected

Definition at line 60 of file Block.php.

Referenced by getTarget(), and parseTarget().

int Block::$type
protected

Block::TYPE_ constant.

Can only be USER, IP or RANGE internally

Definition at line 66 of file Block.php.

Referenced by getType().

const Block::TYPE_ID = 5

The documentation for this class was generated from the following file: