[BUGFIX] Adjust openid return entry point to new Application class 10/40910/3
authorMarkus Klein <markus.klein@typo3.org>
Fri, 3 Jul 2015 11:01:37 +0000 (13:01 +0200)
committerFrank Nägler <frank.naegler@typo3.org>
Fri, 3 Jul 2015 11:44:22 +0000 (13:44 +0200)
Resolves: #67903
Releases: master
Change-Id: I73cb32a8cf591ccf4e07454efc06e5430c8dfec1
Reviewed-on: http://review.typo3.org/40910
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
typo3/sysext/openid/class.tx_openid_return.php

index 7d98f94..a15ee17 100644 (file)
@@ -17,15 +17,17 @@ if (isset($_GET['login_status'])) {
        $_POST['login_status'] = $_GET['login_status'];
 }
 
-define('TYPO3_MOD_PATH', 'sysext/openid/');
-define('TYPO3_MODE', 'BE');
-require '../../sysext/core/Classes/Core/Bootstrap.php';
-\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->run('typo3/');
+call_user_func(function() {
+       define('TYPO3_MOD_PATH', 'sysext/openid/');
 
-/** @var \TYPO3\CMS\Core\Authentication\BackendUserAuthentication $beUser */
-$beUser = $GLOBALS['BE_USER'];
-if ($beUser->user['uid']) {
-       \TYPO3\CMS\Core\Utility\GeneralUtility::cleanOutputBuffers();
-       $backendURL = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir . 'backend.php';
-       \TYPO3\CMS\Core\Utility\HttpUtility::redirect($backendURL);
-}
+       $classLoader = require __DIR__ . '/../../contrib/vendor/autoload.php';
+       (new \TYPO3\CMS\Backend\Http\Application($classLoader))->run(function() {
+               /** @var \TYPO3\CMS\Core\Authentication\BackendUserAuthentication $beUser */
+               $beUser = $GLOBALS['BE_USER'];
+               if ($beUser->user['uid']) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::cleanOutputBuffers();
+                       $backendURL = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir . 'backend.php';
+                       \TYPO3\CMS\Core\Utility\HttpUtility::redirect($backendURL);
+               }
+       });
+});