3 * This file is part of the TYPO3 CMS project.
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.
9 * For the full copyright and license information, please read the
10 * LICENSE.txt file that was distributed with this source code.
12 * The TYPO3 project - inspiring people to share!
15 * Module Dispatch script
17 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
20 require __DIR__
. '/init.php';
22 $moduleName = (string)\TYPO3\CMS\Core\Utility\GeneralUtility
::_GET('M');
23 $isDispatched = FALSE;
24 $formprotection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory
::get();
25 if (!$formprotection->validateToken(\TYPO3\CMS\Core\Utility\GeneralUtility
::_GP('moduleToken'), 'moduleCall', $moduleName)) {
26 throw new UnexpectedValueException('Invalid form/module token detected. Access Denied!', 1392409507);
28 if ($temp_path = $TBE_MODULES['_PATHS'][$moduleName]) {
29 $MCONF['_'] = \TYPO3\CMS\Backend\Utility\BackendUtility
::getModuleUrl($moduleName);
30 require $temp_path . 'conf.php';
32 require $temp_path . 'index.php';
35 if (is_array($TBE_MODULES['_dispatcher'])) {
36 foreach ($TBE_MODULES['_dispatcher'] as $dispatcherClassName) {
37 $dispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility
::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager')->get($dispatcherClassName);
38 if ($dispatcher->callModule($moduleName) === TRUE) {
45 if ($isDispatched === FALSE) {
46 throw new UnexpectedValueException('No module "' . htmlspecialchars($moduleName) . '" could be found.', 1294585070);
48 \TYPO3\CMS\Core\Core\Bootstrap
::getInstance()->shutdown();