[!!!][TASK] Move flash message output to alerts
[Packages/TYPO3.CMS.git] / typo3 / index.php
1 <?php
2 /**
3 * This file is part of the TYPO3 CMS project.
4 *
5 * It is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License, either version 2
7 * of the License, or any later version.
8 *
9 * For the full copyright and license information, please read the
10 * LICENSE.txt file that was distributed with this source code.
11 *
12 * The TYPO3 project - inspiring people to share!
13 */
14
15 /**
16 * Login-screen of TYPO3.
17 *
18 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
19 */
20 define('TYPO3_PROCEED_IF_NO_USER', 1);
21 require __DIR__ . '/init.php';
22
23 // This is a deprecation layer for extensions registered as submodules
24 // of func and info module: Those modules now use mod.php as entry
25 // points and not own index.php anymore, not adapted extensions will
26 // therefor route to this script here. The code sorts out these script
27 // calls and redirects to mod.php.
28 // @deprecated since 6.2, remove two versions later.
29 if (!empty($_SERVER['HTTP_REFERER'])) {
30 $typo3RequestDir = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_DIR');
31 if (strpos($_SERVER['HTTP_REFERER'], $typo3RequestDir . 'mod.php') === 0) {
32 parse_str(substr($_SERVER['HTTP_REFERER'], strpos($_SERVER['HTTP_REFERER'], '?') + 1), $referrerParameters);
33 // As of now, only web_info and web_func have been converted and need the compatibility layer
34 if (!empty($referrerParameters['M']) && in_array($referrerParameters['M'], array('web_info', 'web_func'), TRUE)) {
35 \TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog(
36 'Module ' . $referrerParameters['M'] . ' called index.php. This is deprecated since TYPO3 6.2, use' .
37 ' BackendUtility::getModuleUrl() instead to get the target for your call.'
38 );
39 parse_str($_SERVER['QUERY_STRING'], $queryParameters);
40 header('Location: ' . \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl($referrerParameters['M'], $queryParameters, FALSE, TRUE));
41 exit;
42 }
43 unset($referrerParameters);
44 }
45 unset($typo3RequestDir);
46 }
47
48 $loginController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\LoginController');
49 $loginController->main();
50 $loginController->printContent();