Fixed bug #11396: redirects not working for felogin on pages with access set
authorSteffen Kamper <info@sk-typo3.de>
Thu, 17 Sep 2009 23:27:27 +0000 (23:27 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Thu, 17 Sep 2009 23:27:27 +0000 (23:27 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5968 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/felogin/pi1/class.tx_felogin_pi1.php

index abb9240..8dfe5aa 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2009-09-17  Steffen Kamper  <info@sk-typo3.de>
 
+       * Fixed bug #11396: redirects not working for felogin on pages with access set
        * Follow-up to bug #11985: corrected calls loadScriptaculous() in tceforms
 
 2009-09-17  Ingo Renner  <ingo@typo3.org>
index 327405e..5a74952 100644 (file)
@@ -488,6 +488,11 @@ class tx_felogin_pi1 extends tslib_pibase {
 
 
 
+               if ($this->redirectUrl) {
+                               // use redirectUrl for action tag because of possible access restricted pages
+                       $markerArray['###ACTION_URI###'] = htmlspecialchars($this->redirectUrl);
+                       $this->redirectUrl = '';
+               }
                if (($this->conf['showPermaLogin']) && ($GLOBALS['TYPO3_CONF_VARS']['FE']['permalogin'] == 0 || $GLOBALS['TYPO3_CONF_VARS']['FE']['permalogin'] == 1) && $GLOBALS['TYPO3_CONF_VARS']['FE']['lifetime'] > 0) {
                        $markerArray['###PERMALOGIN###'] = $this->pi_getLL('permalogin', '', 1);
                        if($GLOBALS['TYPO3_CONF_VARS']['FE']['permalogin'] == 1) {
@@ -584,6 +589,18 @@ class tx_felogin_pi1 extends tslib_pibase {
                                                        }
                                                break;
                                        }
+                               } elseif (($this->logintype == '') && ($redirMethod == 'login') && $this->conf['redirectPageLogin']) { 
+                                               // if login and page not accessible
+                                       $this->cObj->typolink('', array(
+                                               'parameter'                             => $this->conf['redirectPageLogin'],
+                                               'linkAccessRestrictedPages' => TRUE,
+                                       ));
+                                       $redirect_url = $this->cObj->lastTypoLinkUrl;
+
+                               } elseif (($this->logintype == '') && ($redirMethod == 'logout') && $this->conf['redirectPageLogout'] && $GLOBALS['TSFE']->loginUser) { 
+                                               // if logout and page not accessible
+                                       $redirect_url = $this->pi_getPageLink(intval($this->conf['redirectPageLogout']), array(), TRUE);
+
                                } elseif ($this->logintype === 'logout') { // after logout
 
                                        // Hook for general actions after after logout has been confirmed