2 namespace TYPO3\CMS\Install\Controller;
50 $this->loadBaseExtensions();
51 $this->initializeObjectManager();
55 $this->outputInstallToolNotEnabledMessageIfNeeded();
56 $this->outputInstallToolPasswordNotSetMessageIfNeeded();
57 $this->initializeSession();
58 $this->checkSessionToken();
60 $this->logoutIfRequested();
61 $this->loginIfRequested();
64 $this->dispatchAuthenticationActions();
72 protected function logoutIfRequested()
75 if ($action ===
'logout') {
81 $formProtection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get(
82 \TYPO3\CMS\Core\FormProtection\InstallToolFormProtection::class
84 $formProtection->clean();
85 $this->session->destroySession();
99 register_shutdown_function(
function () {
100 $error = error_get_last();
101 if ($error !== null) {
102 $errorType = $error[
"type"];
104 if ($errorType & (E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR)) {
105 $getPostValues = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP(
'install');
107 $parameters = array();
110 $context =
'install[context]=standalone';
111 if (isset($getPostValues[
'context']) && $getPostValues[
'context'] ===
'backend') {
112 $context =
'install[context]=backend';
114 $parameters[] = $context;
117 $parameters[] =
'install[controller]=tool';
120 $parameters[] =
'install[action]=loadExtensions';
123 $errorEncoded = json_encode($error);
124 $parameters[] =
'install[lastError]=' . rawurlencode($errorEncoded);
126 $parameters[] =
'install[lastErrorHash]=' . hash_hmac(
'sha1', $errorEncoded,
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'encryptionKey'] .
'InstallToolError');
128 $redirectLocation =
'Install.php?' . implode(
'&', $parameters);
130 if (!headers_sent()) {
131 \TYPO3\CMS\Core\Utility\HttpUtility::redirect(
133 \TYPO3\CMS\Core\Utility\HttpUtility::HTTP_STATUS_303
138 The system detected a fatal error during script execution.
139 Please use the <a href="' . $redirectLocation .
'">extension check tool</a> to find incompatible extensions.
154 $getVars = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET(
'install');
155 $lastError = array();
156 if (isset($getVars[
'lastError']) && isset($getVars[
'lastErrorHash']) && !empty(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'encryptionKey'])) {
157 $calculatedHash = hash_hmac(
'sha1', $getVars[
'lastError'],
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'encryptionKey'] .
'InstallToolError');
158 if ($calculatedHash === $getVars[
'lastErrorHash']) {
159 $lastError = json_decode($getVars[
'lastError'],
true);
171 protected function dispatchAuthenticationActions()
174 if ($action ===
'') {
175 $action =
'importantActions';
178 $actionClass = ucfirst($action);
180 $toolAction = $this->objectManager->get(
'TYPO3\\CMS\\Install\\Controller\\Action\\Tool\\' . $actionClass);
181 if (!($toolAction instanceof Action\ActionInterface)) {
183 $action .
' does not implement ActionInterface',
187 $toolAction->setController(
'tool');
188 $toolAction->setAction($action);
189 $toolAction->setToken($this->generateTokenForAction($action));
192 $this->
output($toolAction->handle());