MediaWiki  master
SystemBlock.php
Go to the documentation of this file.
1 <?php
23 namespace MediaWiki\Block;
24 
33 class SystemBlock extends AbstractBlock {
36 
46  public function __construct( array $options = [] ) {
47  parent::__construct( $options );
48 
49  $defaults = [
50  'systemBlock' => null,
51  ];
52 
53  $options += $defaults;
54 
55  $this->systemBlockType = $options['systemBlock'];
56  }
57 
68  public function getSystemBlockType() {
70  }
71 
75  public function getIdentifier() {
76  return $this->getSystemBlockType();
77  }
78 
82  public function appliesToPasswordReset() {
83  switch ( $this->getSystemBlockType() ) {
84  case null:
85  case 'global-block':
86  return $this->isCreateAccountBlocked();
87  case 'proxy':
88  return true;
89  case 'dnsbl':
90  case 'wgSoftBlockRanges':
91  return false;
92  default:
93  return true;
94  }
95  }
96 
100  public function getBy() {
101  return 0;
102  }
103 
107  public function getByName() {
108  return '';
109  }
110 }
MediaWiki\Block
Definition: AbstractBlock.php:21
MediaWiki\Block\SystemBlock\$systemBlockType
string null $systemBlockType
Definition: SystemBlock.php:35
MediaWiki\Block\AbstractBlock\isCreateAccountBlocked
isCreateAccountBlocked( $x=null)
Get or set the flag indicating whether this block blocks the target from creating an account.
Definition: AbstractBlock.php:226
MediaWiki\Block\SystemBlock\getByName
getByName()
Get the username of the blocking sysop.string
Definition: SystemBlock.php:107
MediaWiki\Block\SystemBlock\getBy
getBy()
Get the user id of the blocking sysop.int (0 for foreign users)
Definition: SystemBlock.php:100
MediaWiki\Block\SystemBlock
System blocks are temporary blocks that are created on enforcement (e.g.
Definition: SystemBlock.php:33
MediaWiki\Block\SystemBlock\getSystemBlockType
getSystemBlockType()
Get the system block type, if any.
Definition: SystemBlock.php:68
MediaWiki\Block\SystemBlock\appliesToPasswordReset
appliesToPasswordReset()
Check if the block prevents a user from resetting their password.1.33 bool The block blocks password ...
Definition: SystemBlock.php:82
MediaWiki\Block\SystemBlock\__construct
__construct(array $options=[])
Create a new block with specified parameters on a user, IP or IP range.
Definition: SystemBlock.php:46
MediaWiki\Block\AbstractBlock
Definition: AbstractBlock.php:36
MediaWiki\Block\SystemBlock\getIdentifier
getIdentifier()
Get the information that identifies this block, such that a user could look up everything that can be...
Definition: SystemBlock.php:75