[BUGFIX] RTE: Image modify dialogue: keep the current image tab
[Packages/TYPO3.CMS.git] / typo3 / mod.php
index 182e6f7..f17d8cc 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-/**
+/*
  * This file is part of the TYPO3 CMS project.
  *
  * It is free software; you can redistribute it and/or modify it under
@@ -11,6 +11,7 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
+
 /**
  * Module Dispatch script
  *
@@ -21,22 +22,28 @@ require __DIR__ . '/init.php';
 // Find module path:
 $moduleName = (string)\TYPO3\CMS\Core\Utility\GeneralUtility::_GET('M');
 $isDispatched = FALSE;
-$formprotection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get();
-if (!$formprotection->validateToken(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('moduleToken'), 'moduleCall', $moduleName)) {
+$formProtection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get();
+if (!$formProtection->validateToken(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('moduleToken'), 'moduleCall', $moduleName)) {
        throw new UnexpectedValueException('Invalid form/module token detected. Access Denied!', 1392409507);
 }
-if ($temp_path = $TBE_MODULES['_PATHS'][$moduleName]) {
-       $MCONF['_'] = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl($moduleName);
+if ($temp_path = $GLOBALS['TBE_MODULES']['_PATHS'][$moduleName]) {
+       $GLOBALS['MCONF']['_'] = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl($moduleName);
        if (file_exists($temp_path . 'conf.php')) {
                require $temp_path . 'conf.php';
+               $moduleConfiguration = $GLOBALS['MCONF'];
+       } else {
+               $moduleConfiguration = $GLOBALS['TBE_MODULES']['_configuration'][$moduleName];
+       }
+       if (!empty($moduleConfiguration['access'])) {
+               $GLOBALS['BE_USER']->modAccess($moduleConfiguration, TRUE);
        }
 
        $BACK_PATH = '';
        require $temp_path . 'index.php';
        $isDispatched = TRUE;
 } else {
-       if (is_array($TBE_MODULES['_dispatcher'])) {
-               foreach ($TBE_MODULES['_dispatcher'] as $dispatcherClassName) {
+       if (is_array($GLOBALS['TBE_MODULES']['_dispatcher'])) {
+               foreach ($GLOBALS['TBE_MODULES']['_dispatcher'] as $dispatcherClassName) {
                        $dispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class)->get($dispatcherClassName);
                        if ($dispatcher->callModule($moduleName) === TRUE) {
                                $isDispatched = TRUE;