MediaWiki master
|
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, ?DatabaseBlock $blockToUpdate, $target, Authority $performer, string $expiry, string $reason, array $blockOptions, array $blockRestrictions, array $tags) | |
placeBlock ( $conflictMode=self::CONFLICT_FAIL) | |
Place a block, checking permissions. | |
placeBlockUnsafe ( $conflictMode=self::CONFLICT_FAIL) | |
Place 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 | CONFLICT_FAIL = false |
On conflict, do not insert the block. | |
const | CONFLICT_NEW = 'new' |
On conflict, create a new block. | |
const | CONFLICT_REBLOCK = true |
On conflict, update the block if there was only one block. | |
const | CONSTRUCTOR_OPTIONS |
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, | ||
?DatabaseBlock | $blockToUpdate, | ||
$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 | |
DatabaseBlock | null | $blockToUpdate | |
string | UserIdentity | null | $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 | Valid options:
|
AbstractRestriction[] | $blockRestrictions | |
string[] | $tags | Tags that should be assigned to the log entry |
Definition at line 203 of file BlockUser.php.
References MediaWiki\Config\ServiceOptions\assertRequiredOptions(), MediaWiki\MainConfigNames\BlockAllowsUTEdit, MediaWiki\Block\AbstractBlock\getTargetName(), MediaWiki\Block\AbstractBlock\getTargetUserIdentity(), MediaWiki\Block\DatabaseBlock\getType(), MediaWiki\Block\BlockPermissionCheckerFactory\newBlockPermissionChecker(), NS_USER_TALK, MediaWiki\Block\BlockUser\parseExpiryInput(), and MediaWiki\Block\Block\TYPE_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 334 of file BlockUser.php.
Referenced by MediaWiki\Block\BlockUser\__construct().
MediaWiki\Block\BlockUser::placeBlock | ( | $conflictMode = self::CONFLICT_FAIL | ) |
Place a block, checking permissions.
string | bool | $conflictMode | The insertion conflict mode. Ignored if a block to update was specified in the constructor, for example by calling UserBlockCommandFactory::newUpdateBlock(). May be one of:
|
Definition at line 452 of file BlockUser.php.
MediaWiki\Block\BlockUser::placeBlockUnsafe | ( | $conflictMode = self::CONFLICT_FAIL | ) |
Place a block without any sort of permissions checks.
string | bool | $conflictMode |
Definition at line 518 of file BlockUser.php.
MediaWiki\Block\BlockUser::setLogDeletionFlags | ( | int | $flags | ) |
int | $flags | One of LogPage::* constants |
Definition at line 318 of file BlockUser.php.
const MediaWiki\Block\BlockUser::CONFLICT_FAIL = false |
On conflict, do not insert the block.
The value is false for b/c
Definition at line 56 of file BlockUser.php.
const MediaWiki\Block\BlockUser::CONFLICT_NEW = 'new' |
On conflict, create a new block.
Definition at line 58 of file BlockUser.php.
const MediaWiki\Block\BlockUser::CONFLICT_REBLOCK = true |
On conflict, update the block if there was only one block.
The value is true for b/c.
Definition at line 60 of file BlockUser.php.
const MediaWiki\Block\BlockUser::CONSTRUCTOR_OPTIONS |
Definition at line 105 of file BlockUser.php.