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',
48 parent::__construct(
'Userlogin' );
61 return AuthManager::ACTION_LOGIN;
65 return $this->
msg(
'login' )->text();
71 if ( $this->securityLevel && $this->
getUser()->isRegistered() ) {
72 $this->
getOutput()->setPageTitle( $this->
msg(
'login-security' ) );
84 $query = array_diff_key( $this->
getRequest()->getValues(),
85 array_fill_keys( [
'type',
'title' ],
true ) );
90 return parent::beforeExecute(
$subPage );
107 $user = $this->targetUser ?: $this->
getUser();
115 if ( $user->requiresHTTPS() ) {
116 $this->mStickHTTPS =
true;
123 $this->
mainLoginForm( [ ], $session->getProvider()->whyNoSession() );
129 # Run any hooks; display injected HTML if any, else redirect
132 $user, $injected_html, $direct );
134 if ( $injected_html !==
'' || $extraMessages ) {
136 'loginsuccess', $injected_html, $extraMessages );
139 $helper->showReturnToPage(
'successredirect', $this->mReturnTo, $this->mReturnToQuery,
140 $this->mStickHTTPS );
145 return $this->
getRequest()->getSession()->getToken(
'',
'login' );
149 return $this->
getRequest()->getSession()->resetToken(
'login' );
153 return 'wpLoginToken';
161 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)
Stable to override.
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...
AuthManager null $authManager
string $subPage
Subpage of the special page.
Holds shared logic for login and account creation pages.
setAuthManager(AuthManager $authManager)
Set the injected AuthManager from the special page constructor.
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()
Stable to override.
__construct(AuthManager $authManager)
getRequest()
Get the WebRequest being used for this instance.
Implements Special:UserLogin.
$wgSecureLogin
This is to let user authenticate using https when they come from http.