LoginController

class \TYPO3\CMS\Backend\Controller\LoginController

Uses
PageRendererBackendSetupTrait

Controller responsible for rendering the TYPO3 Backend login form.

Attributes

#[AsController]

Table of Contents

Properties

$backendEntryPointResolver  : BackendEntryPointResolver
$context  : Context
$eventDispatcher  : EventDispatcherInterface
$extensionConfiguration  : ExtensionConfiguration
$features  : Features
$formProtectionFactory  : FormProtectionFactory
$locales  : Locales
$loginProviderIdentifier  : string
the active login provider identifier
$loginProviderResolver  : LoginProviderResolver
$loginRefresh  : bool
Login-refresh bool; The backend will call this script with this value set when the login is close to being expired and the form needs to be redrawn.
$pageRenderer  : PageRenderer
$redirectToURL  : string
Set to the redirect URL of the form (may be redirect_url or "index.php?M=main")
$redirectUrl  : string
The URL to redirect to after login.
$request  : ServerRequestInterface
$submitValue  : string
Value of forms submit button for login.
$typo3Information  : Typo3Information
$uriBuilder  : UriBuilder
$view  : StandaloneView

Methods

__construct()  : mixed
formAction()  : ResponseInterface
Injects the request and response objects for the current request or subrequest As this controller goes only through the main() method, it is rather simple for now
getCurrentRequest()  : ServerRequestInterface
getLoginProviderIdentifier()  : string
refreshAction()  : ResponseInterface
Calls the main function but with loginRefresh enabled at any time
requestTokenAction()  : ResponseInterface
Returns a new request-token value, which is signed by a new nonce value (the nonce is sent as cookie automatically in `RequestTokenMiddleware` since it is created via the `NoncePool`).
appendLoginProviderCookie()  : ResponseInterface
If a login provider was chosen in the previous request, which is not the default provider, it is stored in a Cookie and appended to the HTTP Response.
checkRedirect()  : void
Checking, if we should perform some sort of redirection OR closing of windows.
createLoginLogoutForm()  : ResponseInterface
Main function - creating the login/logout form
getBackendFavicon()  : string
Retrieves configured favicon for backend with fallback.
getBackendUserAuthentication()  : BackendUserAuthentication
getLanguageService()  : LanguageService
getNormalizedParams()  : NormalizedParams
getRegisteredStylesheetFolders()  : array
Return an array of all stylesheet directories registered via $GLOBAlS['TBE_STYLES']['skins'].
getSystemNews()  : array
Gets news as array from sys_news and converts them into a format suitable for showing them at the login screen.
getUriForFileName()  : string
Returns the uri of a relative reference, resolves the "EXT:" prefix (way of referring to files inside extensions) and checks that the file is inside the project root of the TYPO3 installation
init()  : void
Initialize the login box. Will also react on a &L=OUT flag and exit.
isLoginInProgress()  : bool
Checks if login credentials are currently submitted
loadStylesheets()  : void
Load all registered stylesheets from $GLOBALS['TBE_STYLES'] "API"
provideCustomLoginStyling()  : void
provideRequestTokenJwt()  : string
redirectToUrl()  : void
Wrapper method to redirect to configured redirect URL.
renderHtmlViaLoginProvider()  : void
setUpBasicPageRendererForBackend()  : void
Sets mandatory parameters for the PageRenderer.

Properties

$eventDispatcher read-only

protected EventDispatcherInterface $eventDispatcher

$loginProviderIdentifier

the active login provider identifier

protected string $loginProviderIdentifier = ''

$loginRefresh

Login-refresh bool; The backend will call this script with this value set when the login is close to being expired and the form needs to be redrawn.

protected bool $loginRefresh

$redirectToURL

Set to the redirect URL of the form (may be redirect_url or "index.php?M=main")

protected string $redirectToURL

$redirectUrl

The URL to redirect to after login.

protected string $redirectUrl

$request

protected ServerRequestInterface $request

Tags

todo:

Only set for getCurrentRequest(). Should vanish.

$submitValue

Value of forms submit button for login.

protected string $submitValue

Methods

__construct()

public __construct(Typo3Information $typo3Information, EventDispatcherInterface $eventDispatcher, PageRenderer $pageRenderer, UriBuilder $uriBuilder, Features $features, Context $context, LoginProviderResolver $loginProviderResolver, ExtensionConfiguration $extensionConfiguration, BackendEntryPointResolver $backendEntryPointResolver, FormProtectionFactory $formProtectionFactory, Locales $locales) : mixed

Parameters

$typo3Information : Typo3Information
$eventDispatcher : EventDispatcherInterface
$pageRenderer : PageRenderer
$uriBuilder : UriBuilder
$features : Features
$context : Context
$loginProviderResolver : LoginProviderResolver
$extensionConfiguration : ExtensionConfiguration
$backendEntryPointResolver : BackendEntryPointResolver
$formProtectionFactory : FormProtectionFactory
$locales : Locales

formAction()

Injects the request and response objects for the current request or subrequest As this controller goes only through the main() method, it is rather simple for now

public formAction(ServerRequestInterface $request) : ResponseInterface

Parameters

$request : ServerRequestInterface

Return values

ResponseInterface

getCurrentRequest()

public getCurrentRequest() : ServerRequestInterface

Tags

todo:

Ugly. This can be used by login providers, they receive an instance of $this.

Return values

ServerRequestInterface

getLoginProviderIdentifier()

public getLoginProviderIdentifier() : string

Tags

todo:

Ugly. This can be used by login providers, they receive an instance of $this. Unused in core, though. It should vanish when login providers receive love.

Return values

string

refreshAction()

Calls the main function but with loginRefresh enabled at any time

public refreshAction(ServerRequestInterface $request) : ResponseInterface

Parameters

$request : ServerRequestInterface

Return values

ResponseInterface

requestTokenAction()

Returns a new request-token value, which is signed by a new nonce value (the nonce is sent as cookie automatically in `RequestTokenMiddleware` since it is created via the `NoncePool`).

public requestTokenAction(ServerRequestInterface $request) : ResponseInterface

Parameters

$request : ServerRequestInterface

Return values

ResponseInterface

appendLoginProviderCookie()

If a login provider was chosen in the previous request, which is not the default provider, it is stored in a Cookie and appended to the HTTP Response.

protected appendLoginProviderCookie(ServerRequestInterface $request, NormalizedParams $normalizedParams, ResponseInterface $response) : ResponseInterface

Parameters

$request : ServerRequestInterface
$normalizedParams : NormalizedParams
$response : ResponseInterface

Return values

ResponseInterface

checkRedirect()

Checking, if we should perform some sort of redirection OR closing of windows.

protected checkRedirect(ServerRequestInterface $request) : void

Do a redirect if a user is logged in.

Parameters

$request : ServerRequestInterface

Tags

throws
RuntimeException
throws
UnexpectedValueException
throws
RouteNotFoundException

createLoginLogoutForm()

Main function - creating the login/logout form

protected createLoginLogoutForm(ServerRequestInterface $request) : ResponseInterface

Parameters

$request : ServerRequestInterface

Return values

ResponseInterface

getBackendFavicon()

Retrieves configured favicon for backend with fallback.

protected getBackendFavicon(ExtensionConfiguration $extensionConfiguration, ServerRequestInterface $request) : string

Parameters

$extensionConfiguration : ExtensionConfiguration
$request : ServerRequestInterface

Return values

string

getRegisteredStylesheetFolders()

Return an array of all stylesheet directories registered via $GLOBAlS['TBE_STYLES']['skins'].

protected getRegisteredStylesheetFolders() : array

Deprecated

will be removed in TYPO3 v13.0. Use $GLOBALS['TYPO3_CONF_VARS']['BE']['stylesheets'] instead.

Return values

array

getSystemNews()

Gets news as array from sys_news and converts them into a format suitable for showing them at the login screen.

protected getSystemNews() : array

Return values

array

getUriForFileName()

Returns the uri of a relative reference, resolves the "EXT:" prefix (way of referring to files inside extensions) and checks that the file is inside the project root of the TYPO3 installation

protected getUriForFileName(ServerRequestInterface $request, string $filename) : string

Parameters

$request : ServerRequestInterface
$filename : string

The input filename/filepath to evaluate

Return values

string —

Returns the filename of $filename if valid, otherwise blank string.

init()

Initialize the login box. Will also react on a &L=OUT flag and exit.

protected init(ServerRequestInterface $request) : void

Parameters

$request : ServerRequestInterface

isLoginInProgress()

Checks if login credentials are currently submitted

protected isLoginInProgress(ServerRequestInterface $request) : bool

Parameters

$request : ServerRequestInterface

Return values

bool

loadStylesheets()

Load all registered stylesheets from $GLOBALS['TBE_STYLES'] "API"

protected loadStylesheets(PageRenderer $pageRenderer) : void

Parameters

$pageRenderer : PageRenderer

provideCustomLoginStyling()

protected provideCustomLoginStyling() : void

provideRequestTokenJwt()

protected provideRequestTokenJwt() : string

Return values

string
On this page