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
- $requestHandler : ServerRequestHandler
- $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
$requestHandler
protected
ServerRequestHandler
$requestHandler
$userIsLoggedIn
protected
bool
$userIsLoggedIn
= false
Methods
__construct()
public
__construct(ServerRequestHandler $requestHandler, RedirectModeHandler $redirectModeHandler, Context $context, RedirectUrlValidator $redirectUrlValidator) : mixed
Parameters
- $requestHandler : ServerRequestHandler
- $redirectModeHandler : RedirectModeHandler
- $context : Context
- $redirectUrlValidator : RedirectUrlValidator
getLoginFormRedirectUrl()
Returns the redirect Url that should be used in login form template for GET/POST redirect mode
public
getLoginFormRedirectUrl(RedirectConfiguration $configuration, bool $redirectDisabled) : string
Parameters
- $configuration : RedirectConfiguration
- $redirectDisabled : bool
Return values
stringgetLogoutFormRedirectUrl()
Returns the redirect Url that should be used in logout form
public
getLogoutFormRedirectUrl(RedirectConfiguration $configuration, int $redirectPageLogout, bool $redirectDisabled) : string
Parameters
- $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(ServerRequestInterface $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 : ServerRequestInterface
- $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(string $loginType, RedirectConfiguration $configuration, string $redirectModeReferrer) : string
Parameters
- $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, mixed $redirectFirstMethod) : string
Parameters
- $redirectUrlList : array<string|int, mixed>
- $redirectFirstMethod : mixed
Return values
stringgetGetpostRedirectUrl()
Is used for alternative redirect urls on redirect mode "getpost"
protected
getGetpostRedirectUrl(array<string|int, mixed> $redirectModes) : string
Parameters
- $redirectModes : array<string|int, mixed>
Return values
stringgetLogoutRedirectUrl()
Get alternative logout form redirect url if logout and page not accessible
protected
getLogoutRedirectUrl(array<string|int, mixed> $redirectModes[, int $redirectPageLogout = 0 ]) : string
Parameters
- $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(string $redirectMode[, int $redirectPageLogin = 0 ][, string $domains = '' ][, string $redirectModeReferrer = '' ]) : string
Parameters
- $redirectMode : string
- $redirectPageLogin : int = 0
- $domains : string = ''
- $redirectModeReferrer : string = ''
Return values
stringhandleSuccessfulLogout()
Handle redirect mode logout
protected
handleSuccessfulLogout(string $redirectMode, int $redirectPageLogout) : string
Parameters
- $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