2 namespace TYPO3\CMS\Backend\Http;
55 '/ajax/login/refresh',
56 '/ajax/login/timedout',
85 $this->
boot($proceedIfNoUserIsLoggedIn);
89 return $this->dispatch($request);
93 return $this->dispatchTraditionalAjaxRequest($request);
127 return in_array($ajaxId, $this->publicAjaxIds,
true);
135 protected function boot($proceedIfNoUserIsLoggedIn)
138 ->checkLockedBackendAndRedirectOrDie($proceedIfNoUserIsLoggedIn)
139 ->checkBackendIpOrDie()
140 ->checkSslBackendAndRedirectIfNeeded()
141 ->initializeBackendRouter()
142 ->loadExtensionTables(
true)
143 ->initializeSpriteManager()
144 ->initializeBackendUser()
145 ->initializeBackendAuthentication($proceedIfNoUserIsLoggedIn)
146 ->initializeLanguageObject()
147 ->initializeBackendTemplate()
148 ->endOutputBufferingAndCleanPreviousOutput()
149 ->initializeOutputCompression()
165 'Content-type' =>
'application/json; charset=utf-8',
171 return $dispatcher->dispatch($request,
$response);
180 protected function dispatchTraditionalAjaxRequest($request)
184 $ajaxRegistryEntry = isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'AJAX'][$ajaxID]) ?
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'AJAX'][$ajaxID] : null;
186 $csrfTokenCheck =
false;
187 if ($ajaxRegistryEntry !== null && is_array($ajaxRegistryEntry) && isset($ajaxRegistryEntry[
'callbackMethod'])) {
188 $ajaxScript = $ajaxRegistryEntry[
'callbackMethod'];
189 $csrfTokenCheck = $ajaxRegistryEntry[
'csrfTokenCheck'];
195 $ajaxParams = array(
'request' => $request);
198 if (empty($ajaxID)) {
199 $ajaxObj->setError(
'No valid ajaxID parameter given.');
200 }
elseif (empty($ajaxScript)) {
201 $ajaxObj->setError(
'No backend function registered for ajaxID "' . $ajaxID .
'".');
203 $ajaxObj->setError(
'Invalid CSRF token detected for ajaxID "' . $ajaxID .
'"!');
206 if ($success ===
false) {
207 $ajaxObj->setError(
'Registered backend function for ajaxID "' . $ajaxID .
'" was not found.');
212 return $ajaxObj->render();