[BUGFIX] Workspace Preview not working with lockSSL=3 51/32851/2
authorOliver Hader <oliver@typo3.org>
Thu, 18 Sep 2014 08:07:05 +0000 (10:07 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Thu, 18 Sep 2014 09:36:05 +0000 (11:36 +0200)
The workspace preview does not work with lockSSL=3 being defined
in the Install Tool. First it looks like a CSS issue, in the end
it boils down that the preview IFRAMEs are not correctly
initialized in Workspaces\Hook\TypoScriptFrontendControllerHook.

The mentioned hook is only called once for the request to the
first IFRAME showing the website frontend preview and won't be
called for further.

The reason is, that cache expire headers are sent that prevent
the client to update the preview on each preview request.
That's why the mentioned hook is not called and the IFRAMEs
are not initialized properly. No-Cache headers are sent if a
backend user object is initialized correctly - and that's the
actual bug, a wrong but strict PHP condition, comparing a string
(lockSSL) with an integer value.

The comparison flaw was integrated with issue #54265

Change-Id: I13c5c2f22f5b43b49f8eead88f1bc82daf415cbb
Resolves: #61699
Releases: master, 6.2
Reviewed-on: http://review.typo3.org/32851
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/backend/Classes/FrontendBackendUserAuthentication.php
typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/saltedpasswords/Classes/Utility/ExtensionManagerConfigurationUtility.php

index 91aeaf2..d920db1 100644 (file)
@@ -188,7 +188,7 @@ class FrontendBackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\B
                        }
                }
                // Check SSL (https)
-               if ((int)$GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] && $GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] !== 3) {
+               if ((int)$GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] && (int)$GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] !== 3) {
                        if (!GeneralUtility::getIndpEnv('TYPO3_SSL')) {
                                return FALSE;
                        }
index cadc8f7..130fb9a 100644 (file)
@@ -847,7 +847,7 @@ abstract class AbstractUserAuthentication {
                        if ($this->writeDevLog && !$activeLogin) {
                                GeneralUtility::devLog('User ' . $tempuser[$this->username_column] . ' authenticated from ' . GeneralUtility::getIndpEnv('REMOTE_ADDR') . ' (' . GeneralUtility::getIndpEnv('REMOTE_HOST') . ')', 'TYPO3\\CMS\\Core\\Authentication\\AbstractUserAuthentication', -1);
                        }
-                       if ($GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] == 3 && $this->user_table == 'be_users') {
+                       if ((int)$GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] === 3 && $this->user_table === 'be_users') {
                                $requestStr = substr(GeneralUtility::getIndpEnv('TYPO3_REQUEST_SCRIPT'), strlen(GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir));
                                $backendScript = \TYPO3\CMS\Backend\Utility\BackendUtility::getBackendScript();
                                if ($requestStr == $backendScript && GeneralUtility::getIndpEnv('TYPO3_SSL')) {
index 1c43dba..d3be52a 100644 (file)
@@ -834,7 +834,7 @@ class Bootstrap {
                        } else {
                                $sslPortSuffix = '';
                        }
-                       if ($GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] == 3) {
+                       if ((int)$GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] === 3) {
                                $requestStr = substr(Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_SCRIPT'), strlen(Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir));
                                if ($requestStr === 'index.php' && !Utility\GeneralUtility::getIndpEnv('TYPO3_SSL')) {
                                        list(, $url) = explode('://', Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'), 2);
index 3c913d4..48f452c 100644 (file)
@@ -138,7 +138,7 @@ your TYPO3 installation and the usability of the backend.';
                $this->init();
                $extConf = $this->extConf['BE'];
                // The backend is called over SSL
-               $SSL = $GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] > 0 && $GLOBALS['TYPO3_CONF_VARS']['BE']['loginSecurityLevel'] != 'superchallenged';
+               $SSL = ((int)$GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] > 0 && $GLOBALS['TYPO3_CONF_VARS']['BE']['loginSecurityLevel'] !== 'superchallenged');
                $rsaAuthLoaded = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('rsaauth');
                // SSL configured?
                if ($SSL) {