71 private bool $alwaysRedirectToLoginPage;
93 $reasonMsg =
'exception-nologin-text',
94 $titleMsg =
'exception-nologin',
96 bool $alwaysRedirectToLoginPage =
false
98 $context = RequestContext::getMain();
101 if ( $context->getUser()->isTemp() && !$alwaysRedirectToLoginPage ) {
103 $tempUserReasonMsg = $reasonMsg .
'-for-temp-user';
104 if ( $context->msg( $tempUserReasonMsg )->exists() ) {
105 $reasonMsg = $tempUserReasonMsg;
108 parent::__construct( $titleMsg, $reasonMsg,
$params );
109 $this->alwaysRedirectToLoginPage = $alwaysRedirectToLoginPage;
117 public function report( $action = self::SEND_OUTPUT ) {
121 parent::report( $action );
125 $context = RequestContext::getMain();
129 $specialPageName =
'Userlogin';
130 if ( $context->getUser()->isTemp() && !$this->alwaysRedirectToLoginPage ) {
131 $specialPageName =
'CreateAccount';
134 $output = $context->getOutput();
135 $query = $context->getRequest()->getQueryValues();
137 unset( $query[
'title'] );
141 'returnto' => $context->getTitle()->getFullText(),
143 'warning' => $this->
msg,
145 'display' => $query[
'display'] ??
null,
148 if ( $action === self::SEND_OUTPUT ) {
155class_alias( UserNotLoggedIn::class,
'UserNotLoggedIn' );
wfArrayToCgi( $array1, $array2=null, $prefix='')
This function takes one or two arrays as input, and returns a CGI-style string, e....
Helper functions for the login form that need to be shared with other special pages (such as CentralA...
static getValidErrorMessages()
Returns an array of all valid error messages.
Group all the pieces relevant to the context of a request into one instance.
An error page which can definitely be safely rendered using the OutputPage.
Parent class for all special pages.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...