4 use MediaWiki\HookContainer\ProtectedHookAccessorTrait;
15 use ProtectedHookAccessorTrait;
30 'exception-nologin-text',
32 'changeemail-no-info',
34 'confirmemail_needlogin',
36 'specialmute-login-required',
46 static $messages =
null;
49 (
new HookRunner( MediaWikiServices::getInstance()->getHookContainer() ) )
50 ->onLoginFormValidErrorMessages( $messages );
79 $type, $returnTo =
'', $returnToQuery =
'', $stickHTTPS =
false, $returnToAnchor =
''
82 if ( $type !==
'error' && $config->get( MainConfigNames::RedirectOnLogin ) !==
null ) {
83 $returnTo = $config->get( MainConfigNames::RedirectOnLogin );
85 } elseif ( is_string( $returnToQuery ) ) {
90 $this->getHookRunner()->onPostLoginRedirect( $returnTo, $returnToQuery, $type );
92 $returnToTitle = Title::newFromText( $returnTo ) ?: Title::newMainPage();
94 if ( $config->get( MainConfigNames::ForceHTTPS )
95 || ( $config->get( MainConfigNames::SecureLogin ) && $stickHTTPS )
97 $options = [
'https' ];
99 } elseif ( $config->get( MainConfigNames::SecureLogin ) && !$stickHTTPS ) {
100 $options = [
'http' ];
107 if ( $type ===
'successredirect' ) {
108 $redirectUrl = $returnToTitle->getFullUrlForRedirect( $returnToQuery, $proto )
110 $this->
getOutput()->redirect( $redirectUrl );
112 $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)
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.
Interface for objects which can provide a MediaWiki context on request.