Go to the documentation of this file.
34 AuthManager::ACTION_LOGIN,
35 AuthManager::ACTION_LOGIN_CONTINUE
39 'authform-newtoken' =>
'nocookiesforlogin',
40 'authform-notoken' =>
'sessionfailure',
41 'authform-wrongtoken' =>
'sessionfailure',
45 parent::__construct(
'Userlogin' );
57 return AuthManager::ACTION_LOGIN;
61 return $this->
msg(
'login' )->text();
67 if ( $this->securityLevel && $this->
getUser()->isLoggedIn() ) {
68 $this->
getOutput()->setPageTitle( $this->
msg(
'login-security' ) );
80 $query = array_diff_key( $this->
getRequest()->getValues(),
81 array_fill_keys( [
'type',
'title' ],
true ) );
86 return parent::beforeExecute(
$subPage );
103 $user = $this->targetUser ?: $this->
getUser();
111 if ( $user->requiresHTTPS() ) {
112 $this->mStickHTTPS =
true;
119 $this->
mainLoginForm( [ ], $session->getProvider()->whyNoSession() );
125 # Run any hooks; display injected HTML if any, else redirect
127 Hooks::run(
'UserLoginComplete', [ &$user, &$injected_html, $direct ] );
129 if ( $injected_html !==
'' || $extraMessages ) {
131 'loginsuccess', $injected_html, $extraMessages );
134 $helper->showReturnToPage(
'successredirect', $this->mReturnTo, $this->mReturnToQuery,
135 $this->mStickHTTPS );
140 return $this->
getRequest()->getSession()->getToken(
'',
'login' );
144 return $this->
getRequest()->getSession()->resetToken(
'login' );
148 return 'wpLoginToken';
156 LoggerFactory::getInstance(
'authevents' )->info(
'Login attempt', [
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
getToken()
Returns the CSRF token.
getTokenName()
Returns the name of the CSRF token (under which it should be found in the POST or GET data).
showSuccessPage( $type, $title, $msgname, $injected_html, $extraMessages)
Show the success page.
beforeExecute( $subPage)
Gets called before.
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,...
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
logAuthResult( $success, $status=null)
Logs to the authmanager-stats channel.
Helper functions for the login form that need to be shared with other special pages (such as CentralA...
getDescription()
Returns the name that goes in the <h1> in the special page itself, and also the name that will be l...
successfulAction( $direct=false, $extraMessages=null)
Run any hooks registered for logins, then HTTP redirect to $this->mReturnTo (or Main Page if that's u...
string $subPage
Subpage of the special page.
Holds shared logic for login and account creation pages.
getDefaultAction( $subPage)
Get the default action for this special page, if none is given via URL/POST data.
mainLoginForm(array $requests, $msg='', $msgtype='error')
getUser()
Shortcut to get the User executing this instance.
hasSessionCookie()
Check if a session cookie is present.
getContext()
Gets the context this SpecialPage is executed in.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
doesWrites()
Indicates whether this special page may perform database writes.
getLoginSecurityLevel()
Tells if the special page does something security-sensitive and needs extra defense against a stolen ...
getRequest()
Get the WebRequest being used for this instance.
Implements Special:UserLogin.
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
$wgSecureLogin
This is to let user authenticate using https when they come from http.