MediaWiki  master
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 }
UserBlockedError
Show an error when the user tries to do something whilst blocked.
Definition: UserBlockedError.php:31
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:154
UserBlockedError\__construct
__construct(AbstractBlock $block, User $user=null, Language $language=null, $ip=null)
Stable to call.
Definition: UserBlockedError.php:39
RequestContext\getMain
static getMain()
Get the RequestContext object associated with the main request.
Definition: RequestContext.php:453
MediaWiki\Block\AbstractBlock
Definition: AbstractBlock.php:38
ErrorPageError
An error page which can definitely be safely rendered using the OutputPage.
Definition: ErrorPageError.php:30
User
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition: User.php:55
Language
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
Definition: Language.php:41