41 AuthManager::ACTION_LOGIN,
42 AuthManager::ACTION_LOGIN_CONTINUE
46 'authform-newtoken' =>
'nocookiesforlogin',
47 'authform-notoken' =>
'sessionfailure',
48 'authform-wrongtoken' =>
'sessionfailure',
55 parent::__construct(
'Userlogin' );
72 return AuthManager::ACTION_LOGIN;
76 return $this->
msg(
'login' );
82 if ( $this->securityLevel && $this->
getUser()->isRegistered() ) {
83 $this->
getOutput()->setPageTitleMsg( $this->
msg(
'login-security' ) );
95 $query = array_diff_key( $this->
getRequest()->getValues(),
96 array_fill_keys( [
'type',
'title' ],
true ) );
101 return parent::beforeExecute(
$subPage );
118 $user = $this->targetUser ?: $this->
getUser();
126 if ( $user->requiresHTTPS() ) {
127 $this->mStickHTTPS =
true;
129 $session->setForceHTTPS( $secureLogin && $this->mStickHTTPS );
134 $this->
mainLoginForm( [ ], $session->getProvider()->whyNoSession() );
140 # Run any hooks; display injected HTML if any, else redirect
143 $user, $injected_html, $direct );
145 if ( $injected_html !==
'' || $extraMessages ) {
147 'loginsuccess', $injected_html, $extraMessages );
150 $helper->showReturnToPage(
'successredirect', $this->mReturnTo, $this->mReturnToQuery,
151 $this->mStickHTTPS );
156 return $this->
getRequest()->getSession()->getToken(
'',
'login' );
160 $this->
getRequest()->getSession()->resetToken(
'login' );
164 return 'wpLoginToken';
172 LoggerFactory::getInstance(
'authevents' )->info(
'Login attempt', [
175 'status' => strval( $status ),
184class_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.