RedirectHandler
Resolve felogin related redirects based on the current login type and the selected configuration (redirect mode)
this is a concrete TYPO3 implementation and solely used for EXT:felogin and not part of TYPO3's Core API.
Table of Contents
Properties
- $redirectModeHandler : RedirectModeHandler
- $redirectUrlValidator : RedirectUrlValidator
- $userIsLoggedIn : bool
Methods
- __construct() : mixed
- getLoginFormRedirectUrl() : string
- Returns the redirect Url that should be used in login form template for GET/POST redirect mode
- getLogoutFormRedirectUrl() : string
- Returns the redirect Url that should be used in logout form
- getReferrerForLoginForm() : string
- Determines the `referer` variable used in the login form for loginMode=referer depending on the following evaluation order:
- processRedirect() : string
- Process redirect modes. This method searches for a redirect url using all configured modes and returns it.
- fetchReturnUrlFromList() : string
- Base on setting redirectFirstMethod get first or last entry from redirect url list.
- getGetpostRedirectUrl() : string
- Is used for alternative redirect urls on redirect mode "getpost"
- getLogoutRedirectUrl() : string
- Get alternative logout form redirect url if logout and page not accessible
- handleSuccessfulLogin() : string
- Generate redirect_url for case that the user was successfully logged in
- handleSuccessfulLogout() : string
- Handle redirect mode logout
- isRedirectModeActive() : bool
- isReferrerRedirectEnabled() : bool
- Returns whether redirect based on the referrer is enabled
- isUserLoginFailedAndLoginErrorActive() : bool
Properties
$redirectModeHandler
protected
RedirectModeHandler
$redirectModeHandler
$redirectUrlValidator
protected
RedirectUrlValidator
$redirectUrlValidator
$userIsLoggedIn
protected
bool
$userIsLoggedIn
= false
Methods
__construct()
public
__construct(RedirectModeHandler $redirectModeHandler, RedirectUrlValidator $redirectUrlValidator, Context $context) : mixed
Parameters
- $redirectModeHandler : RedirectModeHandler
- $redirectUrlValidator : RedirectUrlValidator
- $context : Context
getLoginFormRedirectUrl()
Returns the redirect Url that should be used in login form template for GET/POST redirect mode
public
getLoginFormRedirectUrl(RequestInterface $request, RedirectConfiguration $configuration, bool $redirectDisabled) : string
Parameters
- $request : RequestInterface
- $configuration : RedirectConfiguration
- $redirectDisabled : bool
Return values
stringgetLogoutFormRedirectUrl()
Returns the redirect Url that should be used in logout form
public
getLogoutFormRedirectUrl(RequestInterface $request, RedirectConfiguration $configuration, int $redirectPageLogout, bool $redirectDisabled) : string
Parameters
- $request : RequestInterface
- $configuration : RedirectConfiguration
- $redirectPageLogout : int
- $redirectDisabled : bool
Return values
stringgetReferrerForLoginForm()
Determines the `referer` variable used in the login form for loginMode=referer depending on the following evaluation order:
public
getReferrerForLoginForm(RequestInterface $request, array<string|int, mixed> $settings) : string
- HTTP POST parameter
referer
- HTTP GET parameter
referer
- HTTP_REFERER
- URL of initiating request in case plugin has been called via sub-request
The evaluated referer
is only returned, if it is considered valid.
Parameters
- $request : RequestInterface
- $settings : array<string|int, mixed>
Return values
stringprocessRedirect()
Process redirect modes. This method searches for a redirect url using all configured modes and returns it.
public
processRedirect(RequestInterface $request, string $loginType, RedirectConfiguration $configuration, string $redirectModeReferrer) : string
Parameters
- $request : RequestInterface
- $loginType : string
- $configuration : RedirectConfiguration
- $redirectModeReferrer : string
Return values
stringfetchReturnUrlFromList()
Base on setting redirectFirstMethod get first or last entry from redirect url list.
protected
fetchReturnUrlFromList(array<string|int, mixed> $redirectUrlList, string $redirectFirstMethod) : string
Parameters
- $redirectUrlList : array<string|int, mixed>
- $redirectFirstMethod : string
Return values
stringgetGetpostRedirectUrl()
Is used for alternative redirect urls on redirect mode "getpost"
protected
getGetpostRedirectUrl(RequestInterface $request, array<string|int, mixed> $redirectModes) : string
Parameters
- $request : RequestInterface
- $redirectModes : array<string|int, mixed>
Return values
stringgetLogoutRedirectUrl()
Get alternative logout form redirect url if logout and page not accessible
protected
getLogoutRedirectUrl(RequestInterface $request, array<string|int, mixed> $redirectModes[, int $redirectPageLogout = 0 ]) : string
Parameters
- $request : RequestInterface
- $redirectModes : array<string|int, mixed>
- $redirectPageLogout : int = 0
Return values
stringhandleSuccessfulLogin()
Generate redirect_url for case that the user was successfully logged in
protected
handleSuccessfulLogin(RequestInterface $request, string $redirectMode[, int $redirectPageLogin = 0 ][, string $domains = '' ][, string $redirectModeReferrer = '' ]) : string
Parameters
- $request : RequestInterface
- $redirectMode : string
- $redirectPageLogin : int = 0
- $domains : string = ''
- $redirectModeReferrer : string = ''
Return values
stringhandleSuccessfulLogout()
Handle redirect mode logout
protected
handleSuccessfulLogout(RequestInterface $request, string $redirectMode, int $redirectPageLogout) : string
Parameters
- $request : RequestInterface
- $redirectMode : string
- $redirectPageLogout : int
Return values
stringisRedirectModeActive()
protected
isRedirectModeActive(array<string|int, mixed> $redirectModes, string $mode) : bool
Parameters
- $redirectModes : array<string|int, mixed>
- $mode : string
Return values
boolisReferrerRedirectEnabled()
Returns whether redirect based on the referrer is enabled
protected
isReferrerRedirectEnabled(array<string|int, mixed> $settings) : bool
Parameters
- $settings : array<string|int, mixed>
Return values
boolisUserLoginFailedAndLoginErrorActive()
protected
isUserLoginFailedAndLoginErrorActive(array<string|int, mixed> $redirectModes, string $loginType) : bool
Parameters
- $redirectModes : array<string|int, mixed>
- $loginType : string