MediaWiki  master
BlockUser.php
Go to the documentation of this file.
1 <?php
2 
22 namespace MediaWiki\Block;
23 
24 use ChangeTags;
25 use ManualLogEntry;
33 use Message;
34 use Psr\Log\LoggerInterface;
36 use Status;
37 use Title;
38 use User;
39 
45 class BlockUser {
54  private $target;
55 
63  private $targetType;
64 
66  private $performer;
67 
69  private $options;
70 
73 
76 
78  private $blockUtils;
79 
81  private $hookRunner;
82 
85 
87  private $logger;
88 
92  public const CONSTRUCTOR_OPTIONS = [
93  'HideUserContribLimit',
94  'BlockAllowsUTEdit',
95  ];
96 
102  private $rawExpiry;
103 
109  private $expiryTime;
110 
112  private $reason;
113 
115  private $isCreateAccountBlocked = false;
116 
123  private $isUserTalkEditBlocked = null;
124 
126  private $isEmailBlocked = false;
127 
129  private $isHardBlock = true;
130 
132  private $isAutoblocking = true;
133 
135  private $isHideUser = false;
136 
147  private $isPartialRaw = false;
148 
150  private $blockRestrictions = [];
151 
153  private $tags = [];
154 
181  public function __construct(
184  BlockPermissionCheckerFactory $blockPermissionCheckerFactory,
186  HookContainer $hookContainer,
188  LoggerInterface $logger,
189  $target,
191  string $expiry,
192  string $reason,
193  array $blockOptions,
194  array $blockRestrictions,
195  array $tags
196  ) {
197  // Process dependencies
198  $options->assertRequiredOptions( self::CONSTRUCTOR_OPTIONS );
199  $this->options = $options;
200  $this->blockRestrictionStore = $blockRestrictionStore;
201  $this->blockPermissionChecker = $blockPermissionCheckerFactory
203  $target,
204  $performer
205  );
206  $this->blockUtils = $blockUtils;
207  $this->hookRunner = new HookRunner( $hookContainer );
208  $this->databaseBlockStore = $databaseBlockStore;
209  $this->logger = $logger;
210 
211  // Process block target
212  list( $this->target, $rawTargetType ) = AbstractBlock::parseTarget( $target );
213  if ( $rawTargetType !== null ) { // Guard against invalid targets
214  $this->targetType = $rawTargetType;
215  } else {
216  $this->targetType = -1;
217  }
218 
219  // Process other block parameters
220  $this->performer = $performer;
221  $this->rawExpiry = $expiry;
222  $this->expiryTime = self::parseExpiryInput( $this->rawExpiry );
223  $this->reason = $reason;
224  $this->blockRestrictions = $blockRestrictions;
225  $this->tags = $tags;
226 
227  // Process blockOptions
228  foreach ( [
229  'isCreateAccountBlocked',
230  'isEmailBlocked',
231  'isHardBlock',
232  'isAutoblocking',
233  ] as $possibleBlockOption ) {
234  if ( isset( $blockOptions[ $possibleBlockOption ] ) ) {
235  $this->$possibleBlockOption = $blockOptions[ $possibleBlockOption ];
236  }
237  }
238 
239  // This needs to be called after $this->blockRestrictions is set, as
240  // $this->isPartial() makes use of it.
241  if (
242  isset( $blockOptions['isPartial'] ) &&
243  !$this->isPartial()
244  ) {
245  $this->isPartialRaw = $blockOptions['isPartial'];
246  }
247 
248  if (
249  !$this->isPartial() ||
250  in_array( NS_USER_TALK, $this->getNamespaceRestrictions() )
251  ) {
252 
253  // It is possible to block user talk edit. User talk edit is:
254  // - always blocked if the config says so;
255  // - otherwise blocked/unblocked if the option was passed in;
256  // - otherwise defaults to not blocked.
257  if ( !$this->options->get( 'BlockAllowsUTEdit' ) ) {
258  $this->isUserTalkEditBlocked = true;
259  } else {
260  $this->isUserTalkEditBlocked = $blockOptions['isUserTalkEditBlocked'] ?? false;
261  }
262 
263  } else {
264 
265  // It is not possible to block user talk edit. If the option
266  // was passed, an error will be thrown in ::placeBlockUnsafe.
267  // Otherwise, set to not blocked.
268  if ( !isset( $blockOptions['isUserTalkEditBlocked'] ) || !$blockOptions['isUserTalkEditBlocked'] ) {
269  $this->isUserTalkEditBlocked = false;
270  }
271 
272  }
273 
274  if (
275  isset( $blockOptions['isHideUser'] ) &&
276  $this->targetType === AbstractBlock::TYPE_USER
277  ) {
278  $this->isHideUser = $blockOptions['isHideUser'];
279  }
280  }
281 
294  public static function parseExpiryInput( string $expiry ) {
295  if ( wfIsInfinity( $expiry ) ) {
296  return 'infinity';
297  }
298 
299  $expiry = strtotime( $expiry );
300 
301  if ( $expiry < 0 || $expiry === false ) {
302  return false;
303  }
304 
305  return wfTimestamp( TS_MW, $expiry );
306  }
307 
313  private function isPartial() : bool {
314  return $this->blockRestrictions !== [] || $this->isPartialRaw;
315  }
316 
325  private function configureBlock( $sourceBlock = null ) : DatabaseBlock {
326  if ( $sourceBlock === null ) {
327  $block = new DatabaseBlock();
328  } else {
329  $block = clone $sourceBlock;
330  }
331 
332  $isSitewide = !$this->isPartial();
333 
334  $block->setTarget( $this->target );
335  $block->setBlocker( $this->performer );
336  $block->setReason( $this->reason );
337  $block->setExpiry( $this->expiryTime );
338  $block->isCreateAccountBlocked( $this->isCreateAccountBlocked );
339  $block->isEmailBlocked( $this->isEmailBlocked );
340  $block->isHardblock( $this->isHardBlock );
341  $block->isAutoblocking( $this->isAutoblocking );
342  $block->isSitewide( $isSitewide );
343  $block->isUsertalkEditAllowed( !$this->isUserTalkEditBlocked );
344  $block->setHideName( $this->isHideUser );
345 
346  if ( $block->getId() === null ) {
347  // Block wasn't inserted into the DB yet
348  $block->setRestrictions( $this->blockRestrictions );
349  } else {
350  // Block is in the DB, we need to set restrictions through a service
351  $block->setRestrictions(
352  $this->blockRestrictionStore->setBlockId(
353  $block->getId(),
354  $this->blockRestrictions
355  )
356  );
357  }
358 
359  return $block;
360  }
361 
369  public function placeBlock( bool $reblock = false ) : Status {
370  $priorBlock = DatabaseBlock::newFromTarget( $this->target );
371  $priorHideUser = $priorBlock instanceof DatabaseBlock && $priorBlock->getHideName();
372  if (
373  $this->blockPermissionChecker
374  ->checkBasePermissions(
375  $this->isHideUser || $priorHideUser
376  ) !== true
377  ) {
378  return Status::newFatal( $priorHideUser ? 'cant-see-hidden-user' : 'badaccess-group0' );
379  }
380 
381  $blockCheckResult = $this->blockPermissionChecker->checkBlockPermissions();
382  if ( $blockCheckResult !== true ) {
383  return Status::newFatal( $blockCheckResult );
384  }
385 
386  if (
387  $this->isEmailBlocked &&
388  !$this->blockPermissionChecker->checkEmailPermissions()
389  ) {
390  // TODO: Maybe not ignore the error here?
391  $this->isEmailBlocked = false;
392  }
393 
394  if ( $this->tags !== [] ) {
395  // TODO: Use DI, see T245964
397  $this->tags,
398  $this->performer
399  );
400 
401  if ( !$status->isOK() ) {
402  return $status;
403  }
404  }
405 
406  return $this->placeBlockUnsafe( $reblock );
407  }
408 
416  public function placeBlockUnsafe( bool $reblock = false ) : Status {
417  $status = $this->blockUtils->validateTarget( $this->target );
418 
419  if ( !$status->isOK() ) {
420  return $status;
421  }
422 
423  if ( $this->isUserTalkEditBlocked === null ) {
424  return Status::newFatal( 'ipb-prevent-user-talk-edit' );
425  }
426 
427  if (
428  // There should be some expiry
429  strlen( $this->rawExpiry ) === 0 ||
430  // can't be a larger string as 50 (it should be a time format in any way)
431  strlen( $this->rawExpiry ) > 50 ||
432  // the time can't be parsed
433  !$this->expiryTime
434  ) {
435  return Status::newFatal( 'ipb_expiry_invalid' );
436  }
437 
438  if ( $this->expiryTime < wfTimestampNow() ) {
439  return Status::newFatal( 'ipb_expiry_old' );
440  }
441 
442  if ( $this->isHideUser ) {
443  if ( $this->isPartial() ) {
444  return Status::newFatal( 'ipb_hide_partial' );
445  }
446 
447  if ( !wfIsInfinity( $this->rawExpiry ) ) {
448  return Status::newFatal( 'ipb_expiry_temp' );
449  }
450 
451  $hideUserContribLimit = $this->options->get( 'HideUserContribLimit' );
452  if (
453  $hideUserContribLimit !== false &&
454  $this->target->getEditCount() > $hideUserContribLimit
455  ) {
456  return Status::newFatal( 'ipb_hide_invalid', Message::numParam( $hideUserContribLimit ) );
457  }
458  }
459 
460  if ( $this->isPartial() ) {
461  if (
462  $this->blockRestrictions === [] &&
463  !$this->isEmailBlocked &&
464  !$this->isCreateAccountBlocked &&
465  !$this->isUserTalkEditBlocked
466  ) {
467  return Status::newFatal( 'ipb-empty-block' );
468  }
469  }
470 
471  return $this->placeBlockInternal( $reblock );
472  }
473 
482  private function placeBlockInternal( bool $reblock = true ) : Status {
483  $block = $this->configureBlock();
484 
485  $denyReason = [ 'hookaborted' ];
486  if ( !$this->hookRunner->onBlockIp( $block, $this->performer, $denyReason ) ) {
487  $status = Status::newGood();
488  foreach ( $denyReason as $key ) {
489  $status->fatal( $key );
490  }
491  return $status;
492  }
493 
494  // Try to insert block. Is there a conflicting block?
495  $insertStatus = $this->databaseBlockStore->insertBlock( $block );
496  $priorBlock = DatabaseBlock::newFromTarget( $this->target );
497  $isReblock = false;
498  if ( !$insertStatus ) {
499  // Reblock if the caller wants so
500  if ( $reblock ) {
501 
502  if ( $priorBlock === null ) {
503  $this->logger->warning( 'Block could not be inserted. No existing block was found.' );
504  return Status::newFatal( 'ipb-block-not-found', $block->getTarget() );
505  }
506 
507  if ( $block->equals( $priorBlock ) ) {
508  // Block settings are equal => user is already blocked
509  return Status::newFatal( 'ipb_already_blocked', $block->getTarget() );
510  }
511 
512  $currentBlock = $this->configureBlock( $priorBlock );
513  $this->databaseBlockStore->updateBlock( $currentBlock ); // TODO handle failure
514  $isReblock = true;
515  $block = $currentBlock;
516  } else {
517  return Status::newFatal( 'ipb_already_blocked', $block->getTarget() );
518  }
519  }
520 
521  // Set *_deleted fields if requested
522  if ( $this->isHideUser ) {
523  // This should only be the case of $this->target is a user, so we can
524  // safely call ->getId()
525  RevisionDeleteUser::suppressUserName( $this->target, $this->target->getId() );
526  }
527 
528  $this->hookRunner->onBlockIpComplete( $block, $this->performer, $priorBlock );
529 
530  // DatabaseBlock constructor sanitizes certain block options on insert
531  $this->isEmailBlocked = $block->isEmailBlocked();
532  $this->isAutoblocking = $block->isAutoblocking();
533 
534  $this->log( $block, $isReblock );
535 
536  return Status::newGood();
537  }
538 
546  private function getNamespaceRestrictions() : array {
547  $namespaceRestrictions = [];
548  foreach ( $this->blockRestrictions as $restriction ) {
549  if ( $restriction instanceof NamespaceRestriction ) {
550  $namespaceRestrictions[] = $restriction->getValue();
551  }
552  }
553  return $namespaceRestrictions;
554  }
555 
563  private function getPageRestrictions() : array {
564  $pageRestrictions = [];
565  foreach ( $this->blockRestrictions as $restriction ) {
566  if ( $restriction instanceof PageRestriction ) {
567  $pageRestrictions[] = $restriction->getTitle()->getFullText();
568  }
569  }
570  return $pageRestrictions;
571  }
572 
580  private function constructLogParams() : array {
581  $logExpiry = wfIsInfinity( $this->rawExpiry ) ? 'infinity' : $this->rawExpiry;
582  $logParams = [
583  '5::duration' => $logExpiry,
584  '6::flags' => $this->blockLogFlags(),
585  'sitewide' => !$this->isPartial()
586  ];
587 
588  if ( $this->isPartial() ) {
589  $pageRestrictions = $this->getPageRestrictions();
590  $namespaceRestrictions = $this->getNamespaceRestrictions();
591 
592  if ( count( $pageRestrictions ) > 0 ) {
593  $logParams['7::restrictions']['pages'] = $pageRestrictions;
594  }
595  if ( count( $namespaceRestrictions ) > 0 ) {
596  $logParams['7::restrictions']['namespaces'] = $namespaceRestrictions;
597  }
598  }
599  return $logParams;
600  }
601 
608  private function log( DatabaseBlock $block, bool $isReblock ) {
609  $logType = $this->isHideUser ? 'suppress' : 'block';
610  $logAction = $isReblock ? 'reblock' : 'block';
611 
612  $logEntry = new ManualLogEntry( $logType, $logAction );
613  $logEntry->setTarget( Title::makeTitle( NS_USER, $this->target ) );
614  $logEntry->setComment( $this->reason );
615  $logEntry->setPerformer( $this->performer );
616  $logEntry->setParameters( $this->constructLogParams() );
617  // Relate log ID to block ID (T27763)
618  $logEntry->setRelations( [ 'ipb_id' => $block->getId() ] );
619  $logEntry->addTags( $this->tags );
620  $logId = $logEntry->insert();
621  $logEntry->publish( $logId );
622  }
623 
630  private function blockLogFlags() : string {
631  $flags = [];
632 
633  if ( $this->targetType != AbstractBlock::TYPE_USER && !$this->isHardBlock ) {
634  // For grepping: message block-log-flags-anononly
635  $flags[] = 'anononly';
636  }
637 
638  if ( $this->isCreateAccountBlocked ) {
639  // For grepping: message block-log-flags-nocreate
640  $flags[] = 'nocreate';
641  }
642 
643  if ( $this->targetType == AbstractBlock::TYPE_USER && !$this->isAutoblocking ) {
644  // For grepping: message block-log-flags-noautoblock
645  $flags[] = 'noautoblock';
646  }
647 
648  if ( $this->isEmailBlocked ) {
649  // For grepping: message block-log-flags-noemail
650  $flags[] = 'noemail';
651  }
652 
653  if ( $this->options->get( 'BlockAllowsUTEdit' ) && $this->isUserTalkEditBlocked ) {
654  // For grepping: message block-log-flags-nousertalk
655  $flags[] = 'nousertalk';
656  }
657 
658  if ( $this->isHideUser ) {
659  // For grepping: message block-log-flags-hiddenname
660  $flags[] = 'hiddenname';
661  }
662 
663  return implode( ',', $flags );
664  }
665 }
MediaWiki\Block\BlockUser\isPartial
isPartial()
Is the to-be-placed block partial?
Definition: BlockUser.php:313
Message\numParam
static numParam( $num)
Definition: Message.php:1038
MediaWiki\Block\BlockUser\getNamespaceRestrictions
getNamespaceRestrictions()
Build namespace restrictions array from $this->blockRestrictions.
Definition: BlockUser.php:546
MediaWiki\Block\BlockPermissionCheckerFactory
Factory class for BlockPermissionChecker.
Definition: BlockPermissionCheckerFactory.php:34
MediaWiki\Block\BlockUser\__construct
__construct(ServiceOptions $options, BlockRestrictionStore $blockRestrictionStore, BlockPermissionCheckerFactory $blockPermissionCheckerFactory, BlockUtils $blockUtils, HookContainer $hookContainer, DatabaseBlockStore $databaseBlockStore, LoggerInterface $logger, $target, User $performer, string $expiry, string $reason, array $blockOptions, array $blockRestrictions, array $tags)
Definition: BlockUser.php:181
StatusValue\newFatal
static newFatal( $message,... $parameters)
Factory function for fatal errors.
Definition: StatusValue.php:70
MediaWiki\Block
Definition: AbstractBlock.php:21
MediaWiki\Block\BlockUser\$rawExpiry
string $rawExpiry
Expiry of the to-be-placed block exactly as it was passed to the constructor.
Definition: BlockUser.php:102
MediaWiki\Block\BlockUser\$hookRunner
HookRunner $hookRunner
Definition: BlockUser.php:81
MediaWiki\Block\BlockUser
Handles the backend logic of blocking users.
Definition: BlockUser.php:45
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:1831
MediaWiki\Block\BlockUser\$blockUtils
BlockUtils $blockUtils
Definition: BlockUser.php:78
MediaWiki\Block\BlockUtils
Backend class for blocking utils.
Definition: BlockUtils.php:44
MediaWiki\Block\BlockUser\$isEmailBlocked
bool $isEmailBlocked
Definition: BlockUser.php:126
MediaWiki\Block\BlockUser\$tags
string[] $tags
Definition: BlockUser.php:153
MediaWiki\Block\BlockUser\log
log(DatabaseBlock $block, bool $isReblock)
Log the block to Special:Log.
Definition: BlockUser.php:608
MediaWiki\Block\BlockUser\$blockRestrictions
AbstractRestriction[] $blockRestrictions
Definition: BlockUser.php:150
MediaWiki\Block\DatabaseBlockStore
Definition: DatabaseBlockStore.php:44
MediaWiki\Block\BlockUser\placeBlockInternal
placeBlockInternal(bool $reblock=true)
Places a block without any sort of sanity/permission checks, hooks can still abort the block through,...
Definition: BlockUser.php:482
MediaWiki\User\UserIdentity
Interface for objects representing user identity.
Definition: UserIdentity.php:32
MediaWiki\Block\BlockUser\$isUserTalkEditBlocked
bool null $isUserTalkEditBlocked
This may be null when an invalid option was passed to the constructor.
Definition: BlockUser.php:123
MediaWiki\Block\BlockUser\$isHardBlock
bool $isHardBlock
Definition: BlockUser.php:129
Status
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition: Status.php:44
MediaWiki\Block\DatabaseBlock
A DatabaseBlock (unlike a SystemBlock) is stored in the database, may give rise to autoblocks and may...
Definition: DatabaseBlock.php:50
MediaWiki\Block\BlockUser\blockLogFlags
blockLogFlags()
Return a comma-delimited list of flags to be passed to the log reader for this block,...
Definition: BlockUser.php:630
MediaWiki\Block\BlockUser\$isCreateAccountBlocked
bool $isCreateAccountBlocked
Definition: BlockUser.php:115
MediaWiki\Config\ServiceOptions
A class for passing options to services.
Definition: ServiceOptions.php:27
MediaWiki\Block\BlockUser\getPageRestrictions
getPageRestrictions()
Build an array of page restrictions from $this->blockRestrictions.
Definition: BlockUser.php:563
ChangeTags
Definition: ChangeTags.php:30
MediaWiki\Block\BlockUser\$databaseBlockStore
DatabaseBlockStore $databaseBlockStore
Definition: BlockUser.php:84
MediaWiki\Block\BlockUser\parseExpiryInput
static parseExpiryInput(string $expiry)
Convert a submitted expiry time, which may be relative ("2 weeks", etc) or absolute ("24 May 2034",...
Definition: BlockUser.php:294
Title\makeTitle
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:624
wfTimestampNow
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
Definition: GlobalFunctions.php:1860
MediaWiki\Block\BlockPermissionChecker
Block permissions.
Definition: BlockPermissionChecker.php:39
MediaWiki\Block\AbstractBlock\parseTarget
static parseTarget( $target)
From an existing block, get the target and the type of target.
Definition: AbstractBlock.php:340
MediaWiki\Block\AbstractBlock\TYPE_USER
const TYPE_USER
Definition: AbstractBlock.php:91
MediaWiki\Block\BlockUser\$logger
LoggerInterface $logger
Definition: BlockUser.php:87
StatusValue\newGood
static newGood( $value=null)
Factory function for good results.
Definition: StatusValue.php:82
MediaWiki\Block\BlockUser\CONSTRUCTOR_OPTIONS
const CONSTRUCTOR_OPTIONS
Definition: BlockUser.php:92
wfIsInfinity
wfIsInfinity( $str)
Determine input string is represents as infinity.
Definition: GlobalFunctions.php:2763
MediaWiki\Block\BlockUser\$isPartialRaw
bool $isPartialRaw
Flag that needs to be true when the to-be-created block allows all editing, but does not allow some o...
Definition: BlockUser.php:147
MediaWiki\Block\BlockUser\placeBlockUnsafe
placeBlockUnsafe(bool $reblock=false)
Places a block without any sort of permissions checks.
Definition: BlockUser.php:416
NS_USER
const NS_USER
Definition: Defines.php:65
MediaWiki\Block\BlockUser\$expiryTime
string bool $expiryTime
Parsed expiry.
Definition: BlockUser.php:109
RevisionDeleteUser
Backend functions for suppressing and unsuppressing all references to a given user,...
Definition: RevisionDeleteUser.php:35
MediaWiki\Block\Restriction\AbstractRestriction
Definition: AbstractRestriction.php:25
MediaWiki\Block\BlockUser\constructLogParams
constructLogParams()
Prepare $logParams.
Definition: BlockUser.php:580
MediaWiki\Block\Restriction\NamespaceRestriction
Definition: NamespaceRestriction.php:25
ChangeTags\canAddTagsAccompanyingChange
static canAddTagsAccompanyingChange(array $tags, User $user=null)
Is it OK to allow the user to apply all the specified tags at the same time as they edit/make the cha...
Definition: ChangeTags.php:598
MediaWiki\Block\DatabaseBlock\getId
getId()
Get the block ID.int|null
Definition: DatabaseBlock.php:733
Title
Represents a title within MediaWiki.
Definition: Title.php:46
MediaWiki\Block\BlockUser\$isHideUser
bool $isHideUser
Definition: BlockUser.php:135
MediaWiki\Block\BlockUser\placeBlock
placeBlock(bool $reblock=false)
Places a block with checking permissions.
Definition: BlockUser.php:369
MediaWiki\Block\Restriction\PageRestriction
Definition: PageRestriction.php:25
MediaWiki\Block\BlockUser\$isAutoblocking
bool $isAutoblocking
Definition: BlockUser.php:132
MediaWiki\Block\BlockUser\$blockPermissionChecker
BlockPermissionChecker $blockPermissionChecker
Definition: BlockUser.php:75
MediaWiki\Block\BlockUser\$target
User string null $target
Target of the block.
Definition: BlockUser.php:54
MediaWiki\Block\BlockUser\$targetType
int $targetType
One of AbstractBlock::TYPE_* constants.
Definition: BlockUser.php:63
MediaWiki\Block\BlockPermissionCheckerFactory\newBlockPermissionChecker
newBlockPermissionChecker( $target, User $performer)
Definition: BlockPermissionCheckerFactory.php:66
Message
The Message class deals with fetching and processing of interface message into a variety of formats.
Definition: Message.php:161
NS_USER_TALK
const NS_USER_TALK
Definition: Defines.php:66
MediaWiki\Block\DatabaseBlock\newFromTarget
static newFromTarget( $specificTarget, $vagueTarget=null, $fromMaster=false)
Given a target and the target's type, get an existing block object if possible.
Definition: DatabaseBlock.php:849
ManualLogEntry
Class for creating new log entries and inserting them into the database.
Definition: ManualLogEntry.php:43
MediaWiki\Block\BlockUser\$options
ServiceOptions $options
Definition: BlockUser.php:69
MediaWiki\HookContainer\HookContainer
HookContainer class.
Definition: HookContainer.php:45
RevisionDeleteUser\suppressUserName
static suppressUserName( $name, $userId, IDatabase $dbw=null)
Definition: RevisionDeleteUser.php:158
MediaWiki\Block\AbstractBlock\getHideName
getHideName()
Get whether the block hides the target's username.
Definition: AbstractBlock.php:197
MediaWiki\HookContainer\HookRunner
This class provides an implementation of the core hook interfaces, forwarding hook calls to HookConta...
Definition: HookRunner.php:571
MediaWiki\Block\BlockUser\configureBlock
configureBlock( $sourceBlock=null)
Configure DatabaseBlock according to class properties.
Definition: BlockUser.php:325
User
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition: User.php:63
MediaWiki\Block\BlockUser\$reason
string $reason
Definition: BlockUser.php:112
MediaWiki\Config\ServiceOptions\assertRequiredOptions
assertRequiredOptions(array $expectedKeys)
Assert that the list of options provided in this instance exactly match $expectedKeys,...
Definition: ServiceOptions.php:66
MediaWiki\Block\BlockRestrictionStore
Definition: BlockRestrictionStore.php:34
MediaWiki\Block\BlockUser\$performer
User $performer
Performer of the block.
Definition: BlockUser.php:66
MediaWiki\Block\BlockUser\$blockRestrictionStore
BlockRestrictionStore $blockRestrictionStore
Definition: BlockUser.php:72