MediaWiki
REL1_35
UserBlockedError.php
Go to the documentation of this file.
1
<?php
21
use
MediaWiki\Block\AbstractBlock
;
22
use
MediaWiki\MediaWikiServices
;
23
31
class
UserBlockedError
extends
ErrorPageError
{
39
public
function
__construct
(
40
AbstractBlock
$block,
41
User
$user =
null
,
42
Language
$language =
null
,
43
$ip =
null
44
) {
45
if
( $user ===
null
|| $language ===
null
|| $ip ===
null
) {
46
// If any of these are not passed in, use the global context
47
$context = RequestContext::getMain();
48
$user = $context->getUser();
49
$language = $context->getLanguage();
50
$ip = $context->getRequest()->getIP();
51
}
52
53
// @todo This should be passed in via the constructor
54
$message = MediaWikiServices::getInstance()->getBlockErrorFormatter()
55
->getMessage( $block, $user, $language, $ip );
56
parent::__construct(
'blockedtitle'
, $message );
57
}
58
}
ErrorPageError
An error page which can definitely be safely rendered using the OutputPage.
Definition
ErrorPageError.php:30
Language
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
Definition
Language.php:41
MediaWiki\Block\AbstractBlock
Definition
AbstractBlock.php:38
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition
MediaWikiServices.php:152
UserBlockedError
Show an error when the user tries to do something whilst blocked.
Definition
UserBlockedError.php:31
UserBlockedError\__construct
__construct(AbstractBlock $block, User $user=null, Language $language=null, $ip=null)
Stable to call.
Definition
UserBlockedError.php:39
User
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition
User.php:60
includes
exception
UserBlockedError.php
Generated on Sat Apr 6 2024 00:07:08 for MediaWiki by
1.9.8