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 }
__construct(AbstractBlock $block, User $user=null, Language $language=null, $ip=null)
$context
Definition: load.php:45
The User object encapsulates all of the user-specific settings (user_id, name, rights, email address, options, last login time).
Definition: User.php:51
static getMain()
Get the RequestContext object associated with the main request.
An error page which can definitely be safely rendered using the OutputPage.
Show an error when the user tries to do something whilst blocked.