2 namespace TYPO3\CMS\Backend\Http;
79 $this->moduleRegistry =
$GLOBALS[
'TBE_MODULES'];
82 throw new Exception(
'The CSRF protection token for the requested module is missing or invalid', 1417988921);
88 $this->backendUserAuthentication =
$GLOBALS[
'BE_USER'];
90 $moduleName = (string)$this->request->getQueryParams()[
'M'];
92 return $this->dispatchModule($moduleName);
97 throw new Exception(
'No module "' . $moduleName .
'" could be found.', 1294585070);
111 if (defined(
'TYPO3_PROCEED_IF_NO_USER') && TYPO3_PROCEED_IF_NO_USER) {
112 $proceedIfNoUserIsLoggedIn =
true;
114 $proceedIfNoUserIsLoggedIn =
false;
117 $this->bootstrap->checkLockedBackendAndRedirectOrDie()
118 ->checkBackendIpOrDie()
119 ->checkSslBackendAndRedirectIfNeeded()
120 ->initializeBackendRouter()
121 ->loadExtensionTables(
true)
122 ->initializeSpriteManager()
123 ->initializeBackendUser()
124 ->initializeBackendAuthentication($proceedIfNoUserIsLoggedIn)
125 ->initializeLanguageObject()
126 ->initializeBackendTemplate()
127 ->endOutputBufferingAndCleanPreviousOutput()
128 ->initializeOutputCompression()
140 return $request->
getAttribute(
'isModuleRequest',
false);
151 && $this->
getFormProtection()->validateToken((
string)$this->request->getQueryParams()[
'moduleToken'],
'moduleCall', (string)$this->request->getQueryParams()[
'M']);
163 return empty($this->moduleRegistry[
'_PATHS'][$moduleName]);
173 protected function dispatchModule($moduleName)
178 $this->backendUserAuthentication->modAccess($moduleConfiguration,
true);
179 $id = isset($this->request->getQueryParams()[
'id']) ? $this->request->getQueryParams()[
'id'] : $this->request->getParsedBody()[
'id'];
182 $permClause = $this->backendUserAuthentication->getPagePermsClause(
true);
185 throw new \RuntimeException(
'You don\'t have access to this page', 1289917924);
193 if (isset($moduleConfiguration[
'routeTarget'])) {
195 $this->request = $this->request->withAttribute(
'target', $moduleConfiguration[
'routeTarget']);
199 $configuration = array(
200 'extensionName' => $moduleConfiguration[
'extensionName'],
201 'pluginName' => $moduleName
203 if (isset($moduleConfiguration[
'vendorName'])) {
204 $configuration[
'vendorName'] = $moduleConfiguration[
'vendorName'];
209 $content =
$bootstrap->run(
'', $configuration);
226 $moduleBasePath = $this->moduleRegistry[
'_PATHS'][$moduleName];
229 if (file_exists($moduleBasePath .
'conf.php')) {
230 require $moduleBasePath .
'conf.php';
231 $moduleConfiguration =
$MCONF;
235 $GLOBALS[
'MCONF'] = $moduleConfiguration;
236 if (!empty($moduleConfiguration[
'access'])) {
237 $this->backendUserAuthentication->modAccess($moduleConfiguration,
true);
239 if (file_exists($moduleBasePath .
'index.php')) {
241 require $moduleBasePath .
'index.php';
256 if (!isset($this->moduleRegistry[
'_configuration'][$moduleName])) {
257 throw new \RuntimeException(
'Module ' . $moduleName .
' is not configured.', 1289918325);
259 return $this->moduleRegistry[
'_configuration'][$moduleName];