MediaWiki REL1_37
|
Handles the backend logic of blocking users. More...
Public Member Functions | |
__construct (ServiceOptions $options, BlockRestrictionStore $blockRestrictionStore, BlockPermissionCheckerFactory $blockPermissionCheckerFactory, BlockUtils $blockUtils, BlockActionInfo $blockActionInfo, HookContainer $hookContainer, DatabaseBlockStore $databaseBlockStore, UserFactory $userFactory, UserEditTracker $userEditTracker, LoggerInterface $logger, TitleFactory $titleFactory, $target, Authority $performer, string $expiry, string $reason, array $blockOptions, array $blockRestrictions, array $tags) | |
placeBlock (bool $reblock=false) | |
Places a block with checking permissions. | |
placeBlockUnsafe (bool $reblock=false) | |
Places a block without any sort of permissions checks. | |
setLogDeletionFlags (int $flags) | |
Static Public Member Functions | |
static | parseExpiryInput (string $expiry) |
Convert a submitted expiry time, which may be relative ("2 weeks", etc) or absolute ("24 May 2034", etc), into an absolute timestamp we can put into the database. | |
Public Attributes | |
const | CONSTRUCTOR_OPTIONS |
Private Member Functions | |
blockLogFlags () | |
Return a comma-delimited list of flags to be passed to the log reader for this block, to provide more information in the logs. | |
configureBlock ( $sourceBlock=null) | |
Configure DatabaseBlock according to class properties. | |
constructLogParams () | |
Prepare $logParams. | |
getActionRestrictions () | |
Build an array of actions from $this->blockRestrictions. | |
getNamespaceRestrictions () | |
Build namespace restrictions array from $this->blockRestrictions. | |
getPageRestrictions () | |
Build an array of page restrictions from $this->blockRestrictions. | |
isPartial () | |
Is the to-be-placed block partial? | |
log (DatabaseBlock $block, bool $isReblock) | |
Log the block to Special:Log. | |
placeBlockInternal (bool $reblock=true) | |
Places a block without any sort of sanity/permission checks, hooks can still abort the block through, as well as already existing block. | |
Private Attributes | |
BlockActionInfo | $blockActionInfo |
BlockPermissionChecker | $blockPermissionChecker |
AbstractRestriction[] | $blockRestrictions = [] |
BlockRestrictionStore | $blockRestrictionStore |
BlockUtils | $blockUtils |
DatabaseBlockStore | $databaseBlockStore |
string bool | $expiryTime |
Parsed expiry. | |
HookRunner | $hookRunner |
bool | $isAutoblocking = true |
bool | $isCreateAccountBlocked = false |
bool | $isEmailBlocked = false |
bool | $isHardBlock = true |
bool | $isHideUser = false |
bool | $isPartialRaw = false |
Flag that needs to be true when the to-be-created block allows all editing, but does not allow some other action. | |
bool null | $isUserTalkEditBlocked = null |
This may be null when an invalid option was passed to the constructor. | |
int null | $logDeletionFlags |
LoggerInterface | $logger |
ServiceOptions | $options |
Authority | $performer |
Performer of the block. | |
string | $rawExpiry |
Expiry of the to-be-placed block exactly as it was passed to the constructor. | |
string | $reason |
string[] | $tags = [] |
UserIdentity string null | $target |
Target of the block. | |
int | $targetType |
One of AbstractBlock::TYPE_* constants. | |
TitleFactory | $titleFactory |
UserEditTracker | $userEditTracker |
UserFactory | $userFactory |
MediaWiki\Block\BlockUser::__construct | ( | ServiceOptions | $options, |
BlockRestrictionStore | $blockRestrictionStore, | ||
BlockPermissionCheckerFactory | $blockPermissionCheckerFactory, | ||
BlockUtils | $blockUtils, | ||
BlockActionInfo | $blockActionInfo, | ||
HookContainer | $hookContainer, | ||
DatabaseBlockStore | $databaseBlockStore, | ||
UserFactory | $userFactory, | ||
UserEditTracker | $userEditTracker, | ||
LoggerInterface | $logger, | ||
TitleFactory | $titleFactory, | ||
$target, | |||
Authority | $performer, | ||
string | $expiry, | ||
string | $reason, | ||
array | $blockOptions, | ||
array | $blockRestrictions, | ||
array | $tags | ||
) |
ServiceOptions | $options | |
BlockRestrictionStore | $blockRestrictionStore | |
BlockPermissionCheckerFactory | $blockPermissionCheckerFactory | |
BlockUtils | $blockUtils | |
BlockActionInfo | $blockActionInfo | |
HookContainer | $hookContainer | |
DatabaseBlockStore | $databaseBlockStore | |
UserFactory | $userFactory | |
UserEditTracker | $userEditTracker | |
LoggerInterface | $logger | |
TitleFactory | $titleFactory | |
string | UserIdentity | $target | Target of the block |
Authority | $performer | Performer of the block |
string | $expiry | Expiry of the block (timestamp or 'infinity') |
string | $reason | Reason of the block |
bool[] | $blockOptions | Block options Valid options:
|
array | $blockRestrictions | Block restrictions |
string[] | $tags | Tags that should be assigned to the log entry |
Definition at line 206 of file BlockUser.php.
References MediaWiki\Block\BlockUser\$blockActionInfo, MediaWiki\Block\BlockUser\$blockRestrictions, MediaWiki\Block\BlockUser\$blockRestrictionStore, MediaWiki\Block\BlockUser\$blockUtils, MediaWiki\Block\BlockUser\$databaseBlockStore, MediaWiki\Block\BlockUser\$logger, MediaWiki\Block\BlockUser\$options, MediaWiki\Block\BlockUser\$performer, MediaWiki\Block\BlockUser\$reason, MediaWiki\Block\BlockUser\$tags, MediaWiki\Block\BlockUser\$target, MediaWiki\Block\BlockUser\$titleFactory, MediaWiki\Block\BlockUser\$userEditTracker, MediaWiki\Block\BlockUser\$userFactory, MediaWiki\Config\ServiceOptions\assertRequiredOptions(), MediaWiki\Block\BlockUser\getNamespaceRestrictions(), MediaWiki\Block\BlockUser\isPartial(), MediaWiki\Block\BlockPermissionCheckerFactory\newBlockPermissionChecker(), NS_USER_TALK, MediaWiki\Block\BlockUser\parseExpiryInput(), and MediaWiki\Block\Block\TYPE_USER.
|
private |
Return a comma-delimited list of flags to be passed to the log reader for this block, to provide more information in the logs.
Definition at line 728 of file BlockUser.php.
|
private |
Configure DatabaseBlock according to class properties.
DatabaseBlock | null | $sourceBlock | Copy any options from this block, null to construct a new one. |
Definition at line 367 of file BlockUser.php.
|
private |
Prepare $logParams.
Helper method for $this->log()
Definition at line 671 of file BlockUser.php.
|
private |
Build an array of actions from $this->blockRestrictions.
Returns an array of stringified actions.
Definition at line 654 of file BlockUser.php.
|
private |
Build namespace restrictions array from $this->blockRestrictions.
Returns an array of namespace IDs.
Definition at line 620 of file BlockUser.php.
Referenced by MediaWiki\Block\BlockUser\__construct().
|
private |
Build an array of page restrictions from $this->blockRestrictions.
Returns an array of stringified full page titles.
Definition at line 637 of file BlockUser.php.
|
private |
Is the to-be-placed block partial?
Definition at line 355 of file BlockUser.php.
Referenced by MediaWiki\Block\BlockUser\__construct().
|
private |
Log the block to Special:Log.
DatabaseBlock | $block | |
bool | $isReblock |
Definition at line 703 of file BlockUser.php.
References MediaWiki\Block\DatabaseBlock\getId(), and NS_USER.
|
static |
Convert a submitted expiry time, which may be relative ("2 weeks", etc) or absolute ("24 May 2034", etc), into an absolute timestamp we can put into the database.
string | $expiry | Whatever was typed into the form |
Definition at line 335 of file BlockUser.php.
References wfIsInfinity(), and wfTimestamp().
Referenced by MediaWiki\Block\BlockUser\__construct().
MediaWiki\Block\BlockUser::placeBlock | ( | bool | $reblock = false | ) |
Places a block with checking permissions.
bool | $reblock | Should this reblock? |
Definition at line 412 of file BlockUser.php.
|
private |
Places a block without any sort of sanity/permission checks, hooks can still abort the block through, as well as already existing block.
bool | $reblock | Should this reblock? |
Definition at line 541 of file BlockUser.php.
MediaWiki\Block\BlockUser::placeBlockUnsafe | ( | bool | $reblock = false | ) |
Places a block without any sort of permissions checks.
bool | $reblock | Should this reblock? |
Definition at line 475 of file BlockUser.php.
MediaWiki\Block\BlockUser::setLogDeletionFlags | ( | int | $flags | ) |
int | $flags | One of LogPage::* constants |
Definition at line 319 of file BlockUser.php.
|
private |
Definition at line 105 of file BlockUser.php.
Referenced by MediaWiki\Block\BlockUser\__construct().
|
private |
Definition at line 81 of file BlockUser.php.
|
private |
Definition at line 168 of file BlockUser.php.
Referenced by MediaWiki\Block\BlockUser\__construct().
|
private |
Definition at line 78 of file BlockUser.php.
Referenced by MediaWiki\Block\BlockUser\__construct().
|
private |
Definition at line 84 of file BlockUser.php.
Referenced by MediaWiki\Block\BlockUser\__construct().
|
private |
Definition at line 90 of file BlockUser.php.
Referenced by MediaWiki\Block\BlockUser\__construct().
|
private |
Parsed expiry.
This may be false in case of an error in parsing.
Definition at line 127 of file BlockUser.php.
|
private |
Definition at line 87 of file BlockUser.php.
|
private |
Definition at line 150 of file BlockUser.php.
|
private |
Definition at line 133 of file BlockUser.php.
|
private |
Definition at line 144 of file BlockUser.php.
|
private |
Definition at line 147 of file BlockUser.php.
|
private |
Definition at line 153 of file BlockUser.php.
|
private |
Flag that needs to be true when the to-be-created block allows all editing, but does not allow some other action.
This flag is used only by isPartial(), and should not be used anywhere else, even within this class. If you want to determine whether the block will be partial, use $this->isPartial().
Definition at line 165 of file BlockUser.php.
|
private |
This may be null when an invalid option was passed to the constructor.
Such a case is catched in placeBlockUnsafe.
Definition at line 141 of file BlockUser.php.
|
private |
Definition at line 174 of file BlockUser.php.
|
private |
Definition at line 99 of file BlockUser.php.
Referenced by MediaWiki\Block\BlockUser\__construct().
|
private |
Definition at line 75 of file BlockUser.php.
Referenced by MediaWiki\Block\BlockUser\__construct().
|
private |
Performer of the block.
Definition at line 72 of file BlockUser.php.
Referenced by MediaWiki\Block\BlockUser\__construct().
|
private |
Expiry of the to-be-placed block exactly as it was passed to the constructor.
Definition at line 120 of file BlockUser.php.
|
private |
Definition at line 130 of file BlockUser.php.
Referenced by MediaWiki\Block\BlockUser\__construct().
|
private |
Definition at line 171 of file BlockUser.php.
Referenced by MediaWiki\Block\BlockUser\__construct().
|
private |
Target of the block.
This is null in case BlockUtils::parseBlockTarget failed to parse the target. Such case is detected in placeBlockUnsafe, by calling validateTarget from SpecialBlock.
Definition at line 60 of file BlockUser.php.
Referenced by MediaWiki\Block\BlockUser\__construct().
|
private |
One of AbstractBlock::TYPE_* constants.
This will be -1 if BlockUtils::parseBlockTarget failed to parse the target.
Definition at line 69 of file BlockUser.php.
|
private |
Definition at line 102 of file BlockUser.php.
Referenced by MediaWiki\Block\BlockUser\__construct().
|
private |
Definition at line 96 of file BlockUser.php.
Referenced by MediaWiki\Block\BlockUser\__construct().
|
private |
Definition at line 93 of file BlockUser.php.
Referenced by MediaWiki\Block\BlockUser\__construct().
const MediaWiki\Block\BlockUser::CONSTRUCTOR_OPTIONS |
Definition at line 110 of file BlockUser.php.