From 03a502adc40a8807fbdb7df492a40d998dd943cb Mon Sep 17 00:00:00 2001 From: Xavier Perseguers Date: Fri, 22 Jul 2011 13:14:24 +0200 Subject: [PATCH] [FEATURE] felogin: Add hook before HTTP redirect Implement hook into the login process after a successful login if a redirect is performed. When no redirect is performed, postProcContent may be used to perform additional actions. Change-Id: Id6259fb7c843ad08432f1df27a15963276e08611 Resolves: #23671 Releases: 4.6 Reviewed-on: http://review.typo3.org/3471 Reviewed-by: Helmut Hummel Reviewed-by: Xavier Perseguers Tested-by: Xavier Perseguers --- typo3/sysext/felogin/pi1/class.tx_felogin_pi1.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/typo3/sysext/felogin/pi1/class.tx_felogin_pi1.php b/typo3/sysext/felogin/pi1/class.tx_felogin_pi1.php index e3b70fc841fc..390a6a7a32b8 100644 --- a/typo3/sysext/felogin/pi1/class.tx_felogin_pi1.php +++ b/typo3/sysext/felogin/pi1/class.tx_felogin_pi1.php @@ -133,6 +133,18 @@ class tx_felogin_pi1 extends tslib_pibase { if (!$GLOBALS['TSFE']->fe_user->cookieId) { $content .= $this->cObj->stdWrap($this->pi_getLL('cookie_warning', '', 1), $this->conf['cookieWarning_stdWrap.']); } else { + // Add hook for extra processing before redirect + if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['beforeRedirect']) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['beforeRedirect'])) { + $_params = array( + 'loginType' => $this->logintype, + 'redirectUrl' => &$this->redirectUrl, + ); + foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['beforeRedirect'] as $_funcRef) { + if ($_funcRef) { + t3lib_div::callUserFunction($_funcRef, $_params, $this); + } + } + } t3lib_utility_Http::redirect($this->redirectUrl); } } -- 2.20.1