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 
97 }
isCreateAccountBlocked( $x=null)
Get or set the flag indicating whether this block blocks the target from creating an account...
getSystemBlockType()
Get the system block type, if any.
Definition: SystemBlock.php:68
System blocks are temporary blocks that are created on enforcement (e.g.
Definition: SystemBlock.php:33
__construct(array $options=[])
Create a new block with specified parameters on a user, IP or IP range.
Definition: SystemBlock.php:46