57 private bool $alwaysRedirectToLoginPage;
79 $reasonMsg =
'exception-nologin-text',
80 $titleMsg =
'exception-nologin',
82 bool $alwaysRedirectToLoginPage =
false
84 $context = RequestContext::getMain();
87 if ( $context->getUser()->isTemp() && !$alwaysRedirectToLoginPage ) {
89 $tempUserReasonMsg = $reasonMsg .
'-for-temp-user';
90 if ( $context->msg( $tempUserReasonMsg )->exists() ) {
91 $reasonMsg = $tempUserReasonMsg;
94 parent::__construct( $titleMsg, $reasonMsg,
$params );
95 $this->alwaysRedirectToLoginPage = $alwaysRedirectToLoginPage;
103 public function report( $action = self::SEND_OUTPUT ) {
107 parent::report( $action );
111 $context = RequestContext::getMain();
115 $specialPageName =
'Userlogin';
116 if ( $context->getUser()->isTemp() && !$this->alwaysRedirectToLoginPage ) {
117 $specialPageName =
'CreateAccount';
120 $output = $context->getOutput();
121 $query = $context->getRequest()->getQueryValues();
123 unset( $query[
'title'] );
127 'returnto' => $context->getTitle()->getFullText(),
129 'warning' => $this->
msg,
131 'display' => $query[
'display'] ??
null,
134 if ( $action === self::SEND_OUTPUT ) {
141class_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 error and warning messages that can be displayed on Special:UserLogin or Spec...
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,...