MediaWiki
REL1_39
UserBlockedError.php
Go to the documentation of this file.
1
<?php
21
use
MediaWiki\Block\Block
;
22
use
MediaWiki\MediaWikiServices
;
23
use
MediaWiki\User\UserIdentity
;
24
32
class
UserBlockedError
extends
ErrorPageError
{
40
public
function
__construct
(
41
Block
$block,
42
UserIdentity
$user =
null
,
43
Language
$language =
null
,
44
$ip =
null
45
) {
46
if
( $user ===
null
|| $language ===
null
|| $ip ===
null
) {
47
// If any of these are not passed in, use the global context
48
$context = RequestContext::getMain();
49
$user = $context->getUser();
50
$language = $context->getLanguage();
51
$ip = $context->getRequest()->getIP();
52
}
53
54
// @todo This should be passed in via the constructor
55
$message = MediaWikiServices::getInstance()->getBlockErrorFormatter()
56
->getMessage( $block, $user, $language, $ip );
57
parent::__construct(
'blockedtitle'
, $message );
58
}
59
}
ErrorPageError
An error page which can definitely be safely rendered using the OutputPage.
Definition
ErrorPageError.php:30
Language
Base class for language-specific code.
Definition
Language.php:53
MediaWiki\MediaWikiServices
Service locator for MediaWiki core services.
Definition
MediaWikiServices.php:212
UserBlockedError
Show an error when the user tries to do something whilst blocked.
Definition
UserBlockedError.php:32
UserBlockedError\__construct
__construct(Block $block, UserIdentity $user=null, Language $language=null, $ip=null)
Definition
UserBlockedError.php:40
MediaWiki\Block\Block
Represents a block that may prevent users from performing specific operations.
Definition
Block.php:40
MediaWiki\User\UserIdentity
Interface for objects representing user identity.
Definition
UserIdentity.php:39
includes
exception
UserBlockedError.php
Generated on Tue Oct 8 2024 07:22:44 for MediaWiki by
1.10.0