MediaWiki REL1_39
UserBlockedError.php
Go to the documentation of this file.
1<?php
24
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}
An error page which can definitely be safely rendered using the OutputPage.
Base class for language-specific code.
Definition Language.php:53
Service locator for MediaWiki core services.
Show an error when the user tries to do something whilst blocked.
__construct(Block $block, UserIdentity $user=null, Language $language=null, $ip=null)
Represents a block that may prevent users from performing specific operations.
Definition Block.php:40
Interface for objects representing user identity.