[BUGFIX] Allow felogin to work without storage PID 16/62916/2
authorBenni Mack <benni@typo3.org>
Wed, 15 Jan 2020 17:17:01 +0000 (18:17 +0100)
committerDaniel Goerz <daniel.goerz@posteo.de>
Wed, 15 Jan 2020 19:44:28 +0000 (20:44 +0100)
With the system-wide configuration option $GLOBALS['TYPO3_CONF_VARS']['FE']['checkFeUserPid']
set to false, EXT:felogin now allows to still render the form,
instead of throwing a runtime exception before.

Resolves: #84269
Releases: master, 9.5
Change-Id: Id0f0692d33e423929d41b9cdd5401b72cfdf77b0
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62916
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
typo3/sysext/felogin/Classes/Controller/AbstractLoginFormController.php
typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php

index 606a951..5be07c7 100644 (file)
@@ -28,6 +28,9 @@ abstract class AbstractLoginFormController extends ActionController
      */
     protected function getStorageFolders(): array
     {
+        if ((bool)($GLOBALS['TYPO3_CONF_VARS']['FE']['checkFeUserPid'] ?? false) === false) {
+            return [0];
+        }
         $storagePids = explode(',', $this->settings['pages'] ?? '');
         $storagePids = array_map('intval', $storagePids);
 
index 6da8703..8483a81 100644 (file)
@@ -132,7 +132,9 @@ class FrontendLoginController extends AbstractPlugin
         $this->pi_initPIflexForm();
         $this->mergeflexFormValuesIntoConf();
         // Get storage PIDs:
-        if ($this->conf['storagePid']) {
+        if ((bool)($GLOBALS['TYPO3_CONF_VARS']['FE']['checkFeUserPid'] ?? false) === false) {
+            $this->spid = 0;
+        } elseif ($this->conf['storagePid']) {
             if ((int)$this->conf['recursive']) {
                 $this->spid = $this->pi_getPidList($this->conf['storagePid'], (int)$this->conf['recursive']);
             } else {