‪TYPO3CMS  9.5
TYPO3\CMS\Frontend\Middleware\BackendUserAuthenticator Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Middleware\BackendUserAuthenticator:

Public Member Functions

ResponseInterface process (ServerRequestInterface $request, RequestHandlerInterface $handler)
 

Protected Member Functions

FrontendBackendUserAuthentication null initializeBackendUser (ServerRequestInterface $request)
 
bool isAuthenticated (FrontendBackendUserAuthentication $user, NormalizedParams $normalizedParams)
 
 setBackendUserAspect (Context $context, BackendUserAuthentication $user)
 

Detailed Description

This middleware authenticates a Backend User (be_user) (pre)-viewing a frontend page.

This middleware also ensures that $GLOBALS['LANG'] is available, however it is possible that a different middleware later-on might unset the BE_USER as he/she is not allowed to preview a certain page due to rights management. As this can only happen once the page ID is resolved, this will happen after the routing middleware.

Currently, this middleware depends on the availability of $GLOBALS['TSFE'], however, this is solely due to backwards-compatibility and will be disabled in the future.

Definition at line 43 of file BackendUserAuthenticator.php.

Member Function Documentation

◆ initializeBackendUser()

FrontendBackendUserAuthentication null TYPO3\CMS\Frontend\Middleware\BackendUserAuthenticator::initializeBackendUser ( ServerRequestInterface  $request)
protected

Creates the backend user object and returns it.

Parameters
ServerRequestInterface$request
Returns
‪FrontendBackendUserAuthentication|null the backend user object or null if there was no valid user found
Exceptions

Definition at line 105 of file BackendUserAuthenticator.php.

References TYPO3\CMS\Frontend\Middleware\BackendUserAuthenticator\isAuthenticated().

Referenced by TYPO3\CMS\Frontend\Middleware\BackendUserAuthenticator\process().

◆ isAuthenticated()

bool TYPO3\CMS\Frontend\Middleware\BackendUserAuthenticator::isAuthenticated ( FrontendBackendUserAuthentication  $user,
NormalizedParams  $normalizedParams 
)
protected

Implementing the access checks that the TYPO3 CMS bootstrap script does before a user is ever logged in.

Parameters
FrontendBackendUserAuthentication$user
NormalizedParams$normalizedParams
Returns
‪bool Returns TRUE if access is OK

Definition at line 128 of file BackendUserAuthenticator.php.

References $GLOBALS, TYPO3\CMS\Backend\FrontendBackendUserAuthentication\backendCheckLogin(), TYPO3\CMS\Core\Http\NormalizedParams\getRemoteAddress(), and TYPO3\CMS\Core\Http\NormalizedParams\isHttps().

Referenced by TYPO3\CMS\Frontend\Middleware\BackendUserAuthenticator\initializeBackendUser().

◆ process()

ResponseInterface TYPO3\CMS\Frontend\Middleware\BackendUserAuthenticator::process ( ServerRequestInterface  $request,
RequestHandlerInterface  $handler 
)

Creates a frontend user authentication object, tries to authenticate a user and stores the object in $GLOBALS['TSFE']->fe_user.

Parameters
ServerRequestInterface$request
RequestHandlerInterface$handler
Returns
‪ResponseInterface

Definition at line 53 of file BackendUserAuthenticator.php.

References $GLOBALS, TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getCookieName(), TYPO3\CMS\Core\Core\Bootstrap\initializeBackendRouter(), TYPO3\CMS\Frontend\Middleware\BackendUserAuthenticator\initializeBackendUser(), TYPO3\CMS\Core\Core\Bootstrap\initializeLanguageObject(), TYPO3\CMS\Core\Core\Bootstrap\loadExtTables(), and TYPO3\CMS\Frontend\Middleware\BackendUserAuthenticator\setBackendUserAspect().

◆ setBackendUserAspect()

TYPO3\CMS\Frontend\Middleware\BackendUserAuthenticator::setBackendUserAspect ( Context  $context,
BackendUserAuthentication  $user 
)
protected

Register the backend user as aspect

Parameters
Context$context
BackendUserAuthentication | null$user

Definition at line 148 of file BackendUserAuthenticator.php.

References TYPO3\CMS\Core\Context\Context\setAspect().

Referenced by TYPO3\CMS\Frontend\Middleware\BackendUserAuthenticator\process().