3 use MediaWiki\HookContainer\ProtectedHookAccessorTrait;
12 use ProtectedHookAccessorTrait;
27 'exception-nologin-text',
29 'changeemail-no-info',
31 'confirmemail_needlogin',
33 'specialmute-login-required',
43 static $messages =
null;
75 $type, $returnTo =
'', $returnToQuery =
'', $stickHTTPS =
false, $returnToAnchor =
''
78 if (
$type !==
'error' && $config->get( MainConfigNames::RedirectOnLogin ) !==
null ) {
79 $returnTo = $config->get( MainConfigNames::RedirectOnLogin );
81 } elseif ( is_string( $returnToQuery ) ) {
86 $this->getHookRunner()->onPostLoginRedirect( $returnTo, $returnToQuery,
$type );
90 if ( $config->get( MainConfigNames::ForceHTTPS )
91 || ( $config->get( MainConfigNames::SecureLogin ) && $stickHTTPS )
93 $options = [
'https' ];
95 } elseif ( $config->get( MainConfigNames::SecureLogin ) && !$stickHTTPS ) {
96 $options = [
'http' ];
103 if (
$type ===
'successredirect' ) {
104 $redirectUrl = $returnToTitle->getFullUrlForRedirect( $returnToQuery, $proto )
106 $this->
getOutput()->redirect( $redirectUrl );
108 $this->
getOutput()->addReturnTo( $returnToTitle, $returnToQuery,
null, $options );
wfCgiToArray( $query)
This is the logical opposite of wfArrayToCgi(): it accepts a query string as its argument and returns...
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
setContext(IContextSource $context)
static runner()
Get a HookRunner instance for calling hooks using the new interfaces.
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.
__construct(IContextSource $context)
showReturnToPage( $type, $returnTo='', $returnToQuery='', $stickHTTPS=false, $returnToAnchor='')
Show a return link or redirect to it.
static string[] $validErrorMessages
Valid error and warning messages.
A class containing constants representing the names of configuration variables.
static newMainPage(MessageLocalizer $localizer=null)
Create a new Title for the Main Page.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Interface for objects which can provide a MediaWiki context on request.