[TASK] Move FE user intialization into constructor 99/50799/2
authorBenni Mack <benni@typo3.org>
Tue, 29 Nov 2016 09:33:17 +0000 (10:33 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 29 Nov 2016 20:16:46 +0000 (21:16 +0100)
Certain options are set from outside as public property,
however these options are always set and can be set from within
FrontendUserAuthentication itself.

This way, more "logic" is moved from TSFE into the appropriate
objects themselves.

Resolves: #78827
Releases: master
Change-Id: Iba0d0ff805a885895fafb09b8852679f9870dbe9
Reviewed-on: https://review.typo3.org/50799
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/frontend/Classes/Authentication/FrontendUserAuthentication.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index 42b0b1d..1229360 100644 (file)
@@ -154,6 +154,9 @@ class FrontendUserAuthentication extends AbstractUserAuthentication
         $this->sendNoCacheHeaders = false;
         $this->getFallBack = true;
         $this->getMethodEnabled = true;
+        $this->lockIP = $GLOBALS['TYPO3_CONF_VARS']['FE']['lockIP'];
+        $this->checkPid = $GLOBALS['TYPO3_CONF_VARS']['FE']['checkFeUserPid'];
+        $this->lifetime = (int)$GLOBALS['TYPO3_CONF_VARS']['FE']['lifetime'];
     }
 
     /**
index b976bcf..5e11d85 100644 (file)
@@ -992,9 +992,6 @@ class TypoScriptFrontendController
     public function initFEuser()
     {
         $this->fe_user = GeneralUtility::makeInstance(FrontendUserAuthentication::class);
-        $this->fe_user->lockIP = $GLOBALS['TYPO3_CONF_VARS']['FE']['lockIP'];
-        $this->fe_user->checkPid = $GLOBALS['TYPO3_CONF_VARS']['FE']['checkFeUserPid'];
-        $this->fe_user->lifetime = (int)$GLOBALS['TYPO3_CONF_VARS']['FE']['lifetime'];
         // List of pid's acceptable
         $pid = GeneralUtility::_GP('pid');
         $this->fe_user->checkPid_value = $pid ? implode(',', GeneralUtility::intExplode(',', $pid)) : 0;