[BUGFIX] Fix access to time tracker in eID scripts 03/37503/2
authorMathias Brodala <mbrodala@pagemachine.de>
Tue, 3 Mar 2015 14:44:11 +0000 (15:44 +0100)
committerBenjamin Mack <benni@typo3.org>
Tue, 3 Mar 2015 15:26:12 +0000 (16:26 +0100)
During refactoring of request handling setup of the global time
tracker was removed for eID scripts.

This also fixes the setup order in the frontend request handler
since this happened before the "preprocessRequest" hook was executed
in the old index_ts.php

Resolves: #65488
Releases: master
Change-Id: I5b0c63db37360039fdb9d9e0ff29adfa38da22c5
Reviewed-on: http://review.typo3.org/37503
Reviewed-by: Juan Manuel Vergés Solanas <juanmanuel.vergessolanas@gmail.com>
Tested-by: Juan Manuel Vergés Solanas <juanmanuel.vergessolanas@gmail.com>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/frontend/Classes/EidRequestHandler.php
typo3/sysext/frontend/Classes/RequestHandler.php

index 804d768..fc4910a 100644 (file)
@@ -46,6 +46,19 @@ class EidRequestHandler implements RequestHandlerInterface {
         * @return void
         */
        public function handleRequest() {
+               // Timetracking started
+               $configuredCookieName = trim($GLOBALS['TYPO3_CONF_VARS']['BE']['cookieName']);
+               if (empty($configuredCookieName)) {
+                       $configuredCookieName = 'be_typo_user';
+               }
+               if ($_COOKIE[$configuredCookieName]) {
+                       $GLOBALS['TT'] = new \TYPO3\CMS\Core\TimeTracker\TimeTracker();
+               } else {
+                       $GLOBALS['TT'] = new \TYPO3\CMS\Core\TimeTracker\NullTimeTracker();
+               }
+
+               $GLOBALS['TT']->start();
+
                // Hook to preprocess the current request
                if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'])) {
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'] as $hookFunction) {
index 85d2ea1..ac01b3a 100644 (file)
@@ -50,16 +50,6 @@ class RequestHandler implements RequestHandlerInterface {
         * @return void
         */
        public function handleRequest() {
-               // Hook to preprocess the current request:
-               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'])) {
-                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'] as $hookFunction) {
-                               $hookParameters = array();
-                               GeneralUtility::callUserFunction($hookFunction, $hookParameters, $hookParameters);
-                       }
-                       unset($hookFunction);
-                       unset($hookParameters);
-               }
-
                // Timetracking started
                $configuredCookieName = trim($GLOBALS['TYPO3_CONF_VARS']['BE']['cookieName']);
                if (empty($configuredCookieName)) {
@@ -73,6 +63,16 @@ class RequestHandler implements RequestHandlerInterface {
 
                $GLOBALS['TT']->start();
 
+               // Hook to preprocess the current request:
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'])) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/index_ts.php']['preprocessRequest'] as $hookFunction) {
+                               $hookParameters = array();
+                               GeneralUtility::callUserFunction($hookFunction, $hookParameters, $hookParameters);
+                       }
+                       unset($hookFunction);
+                       unset($hookParameters);
+               }
+
                /** @var $GLOBALS['TSFE'] \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */
                $GLOBALS['TSFE'] = GeneralUtility::makeInstance(
                        \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::class,