[BUGFIX] Felogin improperly merges flexforms and TS conf 81/31081/4
authorMarkus Klein <klein.t3@mfc-linz.at>
Mon, 23 Jun 2014 15:48:28 +0000 (17:48 +0200)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Sun, 6 Jul 2014 17:10:19 +0000 (19:10 +0200)
There are two options to show the forgot password link in FE:
 * TypoScript: showForgotPasswordLink
 * Flexforms: showForgotPassword

The flexform values are merged with the TS values, but as these config
options are named differently, they are not overridden properly.

With #50138 the forgot-form is now only displayed when showForgotPassword
is set, hence the TypoScript configuration is not taken into account.

Since we can neither change the flexform, nor the TypoScript, we need to
merge the values in the flexform-merge code part.

This patch reduces the code to use only the documented TypoScript option.

Resolves: #59821
Releases: 6.3, 6.2
Change-Id: I77c391910561a304649d4c747ec868388be3f1a5
Reviewed-on: https://review.typo3.org/31081
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php

index 8178ec1..cf922d0 100644 (file)
@@ -153,7 +153,7 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                }
                // What to display
                $content = '';
-               if ($this->piVars['forgot'] && $this->conf['showForgotPassword']) {
+               if ($this->piVars['forgot'] && $this->conf['showForgotPasswordLink']) {
                        $content .= $this->showForgot();
                } elseif ($this->piVars['forgothash']) {
                        $content .= $this->changePassword();
@@ -584,7 +584,7 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                $markerArray['###NOREDIRECT###'] = $this->noRedirect ? '1' : '0';
                $markerArray['###PREFIXID###'] = $this->prefixId;
                $markerArray = array_merge($markerArray, $this->getUserFieldMarkers());
-               if ($this->flexFormValue('showForgotPassword', 'sDEF') || $this->conf['showForgotPasswordLink']) {
+               if ($this->conf['showForgotPasswordLink']) {
                        $linkpartArray['###FORGOT_PASSWORD_LINK###'] = explode('|', $this->getPageLink('|', array($this->prefixId . '[forgot]' => 1)));
                        $markerArray['###FORGOT_PASSWORD###'] = $this->pi_getLL('ll_forgot_header', '', TRUE);
                } else {
@@ -757,7 +757,7 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
        protected function mergeflexFormValuesIntoConf() {
                $flex = array();
                if ($this->flexFormValue('showForgotPassword', 'sDEF')) {
-                       $flex['showForgotPassword'] = $this->flexFormValue('showForgotPassword', 'sDEF');
+                       $flex['showForgotPasswordLink'] = $this->flexFormValue('showForgotPassword', 'sDEF');
                }
                if ($this->flexFormValue('showPermaLogin', 'sDEF')) {
                        $flex['showPermaLogin'] = $this->flexFormValue('showPermaLogin', 'sDEF');