MediaWiki
REL1_34
SystemBlock.php
Go to the documentation of this file.
1
<?php
23
namespace
MediaWiki\Block
;
24
25
use
IContextSource
;
26
35
class
SystemBlock
extends
AbstractBlock
{
37
private
$systemBlockType
;
38
48
public
function
__construct
( array $options = [] ) {
49
parent::__construct( $options );
50
51
$defaults = [
52
'systemBlock'
=>
null
,
53
];
54
55
$options += $defaults;
56
57
$this->systemBlockType = $options[
'systemBlock'
];
58
}
59
70
public
function
getSystemBlockType
() {
71
return
$this->systemBlockType
;
72
}
73
77
public
function
getPermissionsError
(
IContextSource
$context
) {
78
$params = $this->
getBlockErrorParams
( $context );
79
80
// TODO: Clean up error messages params so we don't have to do this (T227174)
81
$params[ 4 ] = $this->
getSystemBlockType
();
82
83
$msg =
'systemblockedtext'
;
84
85
array_unshift( $params, $msg );
86
87
return
$params;
88
}
89
93
public
function
appliesToPasswordReset
() {
94
switch
( $this->
getSystemBlockType
() ) {
95
case
null
:
96
case
'global-block'
:
97
return
$this->
isCreateAccountBlocked
();
98
case
'proxy'
:
99
return
true
;
100
case
'dnsbl'
:
101
case
'wgSoftBlockRanges'
:
102
return
false
;
103
default
:
104
return
true
;
105
}
106
}
107
108
}
MediaWiki\Block\AbstractBlock
Definition
AbstractBlock.php:34
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:216
MediaWiki\Block\AbstractBlock\getBlockErrorParams
getBlockErrorParams(IContextSource $context)
Get block information used in different block error messages.
Definition
AbstractBlock.php:534
MediaWiki\Block\SystemBlock
System blocks are temporary blocks that are created on enforcement (e.g.
Definition
SystemBlock.php:35
MediaWiki\Block\SystemBlock\getSystemBlockType
getSystemBlockType()
Get the system block type, if any.
Definition
SystemBlock.php:70
MediaWiki\Block\SystemBlock\__construct
__construct(array $options=[])
Create a new block with specified parameters on a user, IP or IP range.
Definition
SystemBlock.php:48
MediaWiki\Block\SystemBlock\getPermissionsError
getPermissionsError(IContextSource $context)
Get the key and parameters for the corresponding error message.1.22 array
Definition
SystemBlock.php:77
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:93
MediaWiki\Block\SystemBlock\$systemBlockType
string null $systemBlockType
Definition
SystemBlock.php:37
IContextSource
Interface for objects which can provide a MediaWiki context on request.
Definition
IContextSource.php:53
$context
$context
Definition
load.php:45
MediaWiki\Block
Definition
AbstractBlock.php:21
includes
block
SystemBlock.php
Generated on Fri Apr 5 2024 23:09:42 for MediaWiki by
1.9.8