MediaWiki REL1_35
|
Multiple Block class. More...
Public Member Functions | ||||
__construct (array $options=[]) | ||||
Create a new block with specified parameters on a user, IP or IP range. | ||||
appliesToNamespace ( $ns) | ||||
Checks if a block applies to a particular namespace.
| ||||
appliesToPage ( $pageId) | ||||
Checks if a block applies to a particular page.This check does not consider whether $this->isUsertalkEditAllowed returns false, as the identity of the user making the hypothetical edit isn't known here (particularly in the case of IP hardblocks, range blocks, and auto-blocks).
| ||||
appliesToPasswordReset () | ||||
Check if the block prevents a user from resetting their password.
| ||||
appliesToRight ( $right) | ||||
Determine whether the block prevents a given right.A right may be blacklisted or whitelisted, or determined from a property on the block object. For certain rights, the property may be overridden according to global configs.
| ||||
appliesToTitle (Title $title) | ||||
Checks if a block applies to a particular title.This check does not consider whether $this->isUsertalkEditAllowed returns false, as the identity of the user making the hypothetical edit isn't known here (particularly in the case of IP hardblocks, range blocks, and auto-blocks).
| ||||
appliesToUsertalk (Title $usertalk=null) | ||||
Determine whether the block allows the user to edit their own user talk page.This is done separately from AbstractBlock::appliesToRight because there is no right for editing one's own user talk page and because the user's talk page needs to be passed into the block object, which is unaware of the user.The ipb_allow_usertalk flag (which corresponds to the property allowUsertalk) is used on sitewide blocks and partial blocks that contain a namespace restriction on the user talk namespace, but do not contain a page restriction on the user's talk page. For all other (i.e. most) partial blocks, the flag is ignored, and the user can always edit their user talk page unless there is a page restriction on their user talk page, in which case they can never edit it. (Ideally the flag would be stored as null in these cases, but the database field isn't nullable.)This method does not validate that the passed in talk page belongs to the block target since the target (an IP) might not be the same as the user's talk page (if they are logged in).
| ||||
getBy () | ||||
Get the user id of the blocking sysop.
| ||||
getByName () | ||||
Get the username of the blocking sysop.
| ||||
getExpiry () | ||||
Get the block expiry time.
| ||||
getIdentifier () | ||||
Get the information that identifies this block, such that a user could look up everything that can be found about this block.May be an ID, array of IDs, type, etc.
| ||||
getOriginalBlocks () | ||||
Get the original blocks from which this block is composed. | ||||
Public Member Functions inherited from MediaWiki\Block\AbstractBlock | ||||
getBlocker () | ||||
Get the user who implemented this block. | ||||
getBlockErrorParams (IContextSource $context) | ||||
Get block information used in different block error messages. | ||||
getHideName () | ||||
Get whether the block hides the target's username. | ||||
getId () | ||||
Get the block ID. | ||||
getPermissionsError (IContextSource $context) | ||||
Get the key and parameters for the corresponding error message. | ||||
getReason () | ||||
Get the reason given for creating the block, as a string. | ||||
getReasonComment () | ||||
Get the reason for creating the block. | ||||
getTarget () | ||||
Get the target for this particular block. | ||||
getTargetAndType () | ||||
Get the target and target type for this particular block. | ||||
getTimestamp () | ||||
Get the timestamp indicating when the block was created. | ||||
getType () | ||||
Get the type of target for this particular block. | ||||
isCreateAccountBlocked ( $x=null) | ||||
Get or set the flag indicating whether this block blocks the target from creating an account. | ||||
isEmailBlocked ( $x=null) | ||||
Get or set the flag indicating whether this block blocks the target from sending emails. | ||||
isSitewide ( $x=null) | ||||
Indicates that the block is a sitewide block. | ||||
isUsertalkEditAllowed ( $x=null) | ||||
Get or set the flag indicating whether this block blocks the target from editing their own user talk page. | ||||
prevents ( $action, $x=null) | ||||
Get/set whether the block prevents a given action. | ||||
setBlocker ( $user) | ||||
Set the user who implemented (or will implement) this block. | ||||
setExpiry ( $expiry) | ||||
Set the block expiry time. | ||||
setHideName ( $hideName) | ||||
Set whether ths block hides the target's username. | ||||
setReason ( $reason) | ||||
Set the reason for creating the block. | ||||
setTarget ( $target) | ||||
Set the target for this block, and update $this->type accordingly. | ||||
setTimestamp ( $timestamp) | ||||
Set the timestamp indicating when the block was created. | ||||
shouldTrackWithCookie ( $isAnon) | ||||
Check if the block should be tracked with a cookie. | ||||
Private Member Functions | |
methodReturnsValue ( $method, $value,... $params) | |
Determine whether any original blocks have a particular method returning a particular value. | |
propHasValue ( $prop, $value) | |
Determine whether any original blocks have a particular property set to a particular value. | |
Private Attributes | |
AbstractBlock[] | $originalBlocks |
Additional Inherited Members | |
Static Public Member Functions inherited from MediaWiki\Block\AbstractBlock | |
static | parseTarget ( $target) |
From an existing block, get the target and the type of target. | |
Public Attributes inherited from MediaWiki\Block\AbstractBlock | |
string | $mExpiry = '' |
bool | $mHideName = false |
string | $mTimestamp |
const | TYPE_AUTO = 4 |
const | TYPE_ID = 5 |
const | TYPE_IP = 2 |
const | TYPE_RANGE = 3 |
const | TYPE_USER = 1 |
Protected Attributes inherited from MediaWiki\Block\AbstractBlock | |
bool | $allowUsertalk = false |
bool | $blockCreateAccount = false |
bool | $isSitewide = true |
bool | $mBlockEmail = false |
$mReason | |
CommentStoreComment | $reason |
User string null | $target |
int null | $type |
AbstractBlock::TYPE_ constant. | |
Multiple Block class.
Multiple blocks exist to enforce restrictions from more than one block, if several blocks apply to a user/IP. Multiple blocks are created temporarily on enforcement.
Definition at line 35 of file CompositeBlock.php.
MediaWiki\Block\CompositeBlock::__construct | ( | array | $options = [] | ) |
Create a new block with specified parameters on a user, IP or IP range.
array | $options | Parameters of the block, with options supported by AbstractBlock::__construct , and also:
|
Reimplemented from MediaWiki\Block\AbstractBlock.
Definition at line 46 of file CompositeBlock.php.
References MediaWiki\Block\AbstractBlock\isCreateAccountBlocked(), MediaWiki\Block\AbstractBlock\isEmailBlocked(), MediaWiki\Block\AbstractBlock\isSitewide(), MediaWiki\Block\AbstractBlock\isUsertalkEditAllowed(), MediaWiki\Block\CompositeBlock\propHasValue(), and MediaWiki\Block\AbstractBlock\setHideName().
MediaWiki\Block\CompositeBlock::appliesToNamespace | ( | $ns | ) |
Checks if a block applies to a particular namespace.
int | $ns |
Reimplemented from MediaWiki\Block\AbstractBlock.
Definition at line 177 of file CompositeBlock.php.
References MediaWiki\Block\CompositeBlock\methodReturnsValue().
MediaWiki\Block\CompositeBlock::appliesToPage | ( | $pageId | ) |
Checks if a block applies to a particular page.This check does not consider whether $this->isUsertalkEditAllowed
returns false, as the identity of the user making the hypothetical edit isn't known here (particularly in the case of IP hardblocks, range blocks, and auto-blocks).
int | $pageId |
Reimplemented from MediaWiki\Block\AbstractBlock.
Definition at line 184 of file CompositeBlock.php.
References MediaWiki\Block\CompositeBlock\methodReturnsValue().
MediaWiki\Block\CompositeBlock::appliesToPasswordReset | ( | ) |
Check if the block prevents a user from resetting their password.
Reimplemented from MediaWiki\Block\AbstractBlock.
Definition at line 191 of file CompositeBlock.php.
References MediaWiki\Block\CompositeBlock\methodReturnsValue().
MediaWiki\Block\CompositeBlock::appliesToRight | ( | $right | ) |
Determine whether the block prevents a given right.A right may be blacklisted or whitelisted, or determined from a property on the block object. For certain rights, the property may be overridden according to global configs.
string | $right |
Determines whether the CompositeBlock applies to a right by checking whether the original blocks apply to that right. Each block can report true (applies), false (does not apply) or null (unsure). Then:
Reimplemented from MediaWiki\Block\AbstractBlock.
Definition at line 144 of file CompositeBlock.php.
MediaWiki\Block\CompositeBlock::appliesToTitle | ( | Title | $title | ) |
Checks if a block applies to a particular title.This check does not consider whether $this->isUsertalkEditAllowed
returns false, as the identity of the user making the hypothetical edit isn't known here (particularly in the case of IP hardblocks, range blocks, and auto-blocks).
Title | $title |
Reimplemented from MediaWiki\Block\AbstractBlock.
Definition at line 170 of file CompositeBlock.php.
References $title, and MediaWiki\Block\CompositeBlock\methodReturnsValue().
MediaWiki\Block\CompositeBlock::appliesToUsertalk | ( | Title | $usertalk = null | ) |
Determine whether the block allows the user to edit their own user talk page.This is done separately from AbstractBlock::appliesToRight because there is no right for editing one's own user talk page and because the user's talk page needs to be passed into the block object, which is unaware of the user.The ipb_allow_usertalk flag (which corresponds to the property allowUsertalk) is used on sitewide blocks and partial blocks that contain a namespace restriction on the user talk namespace, but do not contain a page restriction on the user's talk page. For all other (i.e. most) partial blocks, the flag is ignored, and the user can always edit their user talk page unless there is a page restriction on their user talk page, in which case they can never edit it. (Ideally the flag would be stored as null in these cases, but the database field isn't nullable.)This method does not validate that the passed in talk page belongs to the block target since the target (an IP) might not be the same as the user's talk page (if they are logged in).
Title | null | $usertalk | The user's user talk page. If null, and if the target is a User, the target's userpage is used |
Reimplemented from MediaWiki\Block\AbstractBlock.
Definition at line 163 of file CompositeBlock.php.
References MediaWiki\Block\CompositeBlock\methodReturnsValue().
MediaWiki\Block\CompositeBlock::getBy | ( | ) |
Get the user id of the blocking sysop.
Reimplemented from MediaWiki\Block\AbstractBlock.
Definition at line 198 of file CompositeBlock.php.
MediaWiki\Block\CompositeBlock::getByName | ( | ) |
Get the username of the blocking sysop.
Reimplemented from MediaWiki\Block\AbstractBlock.
Definition at line 205 of file CompositeBlock.php.
MediaWiki\Block\CompositeBlock::getExpiry | ( | ) |
Get the block expiry time.
Reimplemented from MediaWiki\Block\AbstractBlock.
Definition at line 112 of file CompositeBlock.php.
MediaWiki\Block\CompositeBlock::getIdentifier | ( | ) |
Get the information that identifies this block, such that a user could look up everything that can be found about this block.May be an ID, array of IDs, type, etc.
Reimplemented from MediaWiki\Block\AbstractBlock.
Definition at line 126 of file CompositeBlock.php.
MediaWiki\Block\CompositeBlock::getOriginalBlocks | ( | ) |
Get the original blocks from which this block is composed.
Definition at line 105 of file CompositeBlock.php.
References MediaWiki\Block\CompositeBlock\$originalBlocks.
|
private |
Determine whether any original blocks have a particular method returning a particular value.
string | $method | |
mixed | $value | |
mixed | ...$params |
Definition at line 90 of file CompositeBlock.php.
Referenced by MediaWiki\Block\CompositeBlock\appliesToNamespace(), MediaWiki\Block\CompositeBlock\appliesToPage(), MediaWiki\Block\CompositeBlock\appliesToPasswordReset(), MediaWiki\Block\CompositeBlock\appliesToTitle(), and MediaWiki\Block\CompositeBlock\appliesToUsertalk().
|
private |
Determine whether any original blocks have a particular property set to a particular value.
string | $prop | |
mixed | $value |
Definition at line 72 of file CompositeBlock.php.
Referenced by MediaWiki\Block\CompositeBlock\__construct().
|
private |
Definition at line 37 of file CompositeBlock.php.
Referenced by MediaWiki\Block\CompositeBlock\getOriginalBlocks().