MediaWiki  master
UserBlockedError.php
Go to the documentation of this file.
1 <?php
23 
37  public function __construct(
38  AbstractBlock $block,
39  User $user = null,
40  Language $language = null,
41  $ip = null
42  ) {
43  if ( $user === null || $language === null || $ip === null ) {
44  // If any of these are not passed in, use the global context
46  $user = $context->getUser();
47  $language = $context->getLanguage();
48  $ip = $context->getRequest()->getIP();
49  }
50 
51  // @todo This should be passed in via the constructor
52  $message = MediaWikiServices::getInstance()->getBlockErrorFormatter()
53  ->getMessage( $block, $user, $language, $ip );
54  parent::__construct( 'blockedtitle', $message );
55  }
56 }
UserBlockedError
Show an error when the user tries to do something whilst blocked.
Definition: UserBlockedError.php:30
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:149
UserBlockedError\__construct
__construct(AbstractBlock $block, User $user=null, Language $language=null, $ip=null)
Definition: UserBlockedError.php:37
RequestContext\getMain
static getMain()
Get the RequestContext object associated with the main request.
Definition: RequestContext.php:451
$context
$context
Definition: load.php:43
MediaWiki\Block\AbstractBlock
Definition: AbstractBlock.php:37
ErrorPageError
An error page which can definitely be safely rendered using the OutputPage.
Definition: ErrorPageError.php:27
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