MediaWiki REL1_35
UserBlockedError.php
Go to the documentation of this file.
1<?php
23
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}
An error page which can definitely be safely rendered using the OutputPage.
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
Definition Language.php:41
MediaWikiServices is the service locator for the application scope of MediaWiki.
Show an error when the user tries to do something whilst blocked.
__construct(AbstractBlock $block, User $user=null, Language $language=null, $ip=null)
Stable to call.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition User.php:60