39 AuthManager::ACTION_LOGIN,
40 AuthManager::ACTION_LOGIN_CONTINUE
44 'authform-newtoken' =>
'nocookiesforlogin',
45 'authform-notoken' =>
'sessionfailure',
46 'authform-wrongtoken' =>
'sessionfailure',
53 parent::__construct(
'Userlogin' );
70 return AuthManager::ACTION_LOGIN;
74 return $this->
msg(
'login' );
80 if ( $this->securityLevel && $this->
getUser()->isRegistered() ) {
81 $this->
getOutput()->setPageTitleMsg( $this->
msg(
'login-security' ) );
93 $query = array_diff_key( $this->
getRequest()->getValues(),
94 array_fill_keys( [
'type',
'title' ],
true ) );
99 return parent::beforeExecute(
$subPage );
116 $user = $this->targetUser ?: $this->
getUser();
125 if ( $user->requiresHTTPS() ) {
126 $this->mStickHTTPS =
true;
128 $session->setForceHTTPS( $secureLogin && $this->mStickHTTPS );
133 $this->
mainLoginForm( [ ], $session->getProvider()->whyNoSession() );
138 # Run any hooks; display injected HTML if any, else redirect
140 $user, $injected_html, $direct );
143 if ( $injected_html !==
'' || $extraMessages ) {
145 'loginsuccess', $injected_html, $extraMessages );
148 $helper->showReturnToPage(
'successredirect', $this->mReturnTo, $this->mReturnToQuery,
149 $this->mStickHTTPS, $this->mReturnToAnchor );
154 return $this->
getRequest()->getSession()->getToken(
'',
'login' );
158 $this->
getRequest()->getSession()->resetToken(
'login' );
162 return 'wpLoginToken';
170 LoggerFactory::getInstance(
'authevents' )->info(
'Login attempt', [
173 'status' => strval( $status ),
182class_alias( SpecialUserLogin::class,
'SpecialUserLogin' );
Helper functions for the login form that need to be shared with other special pages (such as CentralA...
A class containing constants representing the names of configuration variables.
const SecureLogin
Name constant for the SecureLogin setting, for use with Config::get()
string $subPage
Subpage of the special page.
getRequest()
Get the WebRequest being used for this instance.
Holds shared logic for login and account creation pages.
showSuccessPage( $type, $title, $msgname, $injected_html, $extraMessages)
Show the success page.
mainLoginForm(array $requests, $msg='', $msgtype='error')
hasSessionCookie()
Check if a session cookie is present.
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,...
getUser()
Shortcut to get the User executing this instance.
setAuthManager(AuthManager $authManager)
Set the injected AuthManager from the special page constructor.
getConfig()
Shortcut to get main config object.
getContext()
Gets the context this SpecialPage is executed in.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
Generic operation result class Has warning/error list, boolean status and arbitrary value.