‪TYPO3CMS  10.4
MaintenanceController.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Psr\Http\Message\ResponseInterface;
21 use Psr\Http\Message\ServerRequestInterface;
23 use TYPO3\CMS\Core\Configuration\ConfigurationManager;
44 
50 {
54  private ‪$lateBootService;
55 
59  private ‪$clearCacheService;
60 
65 
70 
75 
79  private ‪$locales;
80 
81  public function ‪__construct(
85  ConfigurationManager ‪$configurationManager,
88  ) {
89  $this->lateBootService = ‪$lateBootService;
90  $this->clearCacheService = ‪$clearCacheService;
91  $this->typo3tempFileService = ‪$typo3tempFileService;
92  $this->configurationManager = ‪$configurationManager;
93  $this->passwordHashFactory = ‪$passwordHashFactory;
94  $this->locales = ‪$locales;
95  }
102  public function ‪cardsAction(ServerRequestInterface $request): ResponseInterface
103  {
104  $view = $this->‪initializeStandaloneView($request, 'Maintenance/Cards.html');
105  return new ‪JsonResponse([
106  'success' => true,
107  'html' => $view->render(),
108  ]);
109  }
110 
116  public function ‪cacheClearAllAction(): ResponseInterface
117  {
118  $this->clearCacheService->clearAll();
119  GeneralUtility::makeInstance(OpcodeCacheService::class)->clearAllActive();
120  $messageQueue = (new ‪FlashMessageQueue('install'))->enqueue(
121  new ‪FlashMessage('Successfully cleared all caches and all available opcode caches.', 'Caches cleared')
122  );
123  return new ‪JsonResponse([
124  'success' => true,
125  'status' => $messageQueue,
126  ]);
127  }
128 
135  public function ‪clearTypo3tempFilesStatsAction(ServerRequestInterface $request): ResponseInterface
136  {
137  $this->lateBootService->loadExtLocalconfDatabaseAndExtTables();
138  $view = $this->‪initializeStandaloneView($request, 'Maintenance/ClearTypo3tempFiles.html');
139  $formProtection = ‪FormProtectionFactory::get(InstallToolFormProtection::class);
140  $view->assignMultiple([
141  'clearTypo3tempFilesToken' => $formProtection->generateToken('installTool', 'clearTypo3tempFiles'),
142  ]);
143  return new ‪JsonResponse(
144  [
145  'success' => true,
146  'stats' => $this->typo3tempFileService->getDirectoryStatistics(),
147  'html' => $view->render(),
148  'buttons' => [
149  [
150  'btnClass' => 'btn-default t3js-clearTypo3temp-stats',
151  'text' => 'Scan again',
152  ],
153  ],
154  ]
155  );
156  }
157 
164  public function ‪clearTypo3tempFilesAction(ServerRequestInterface $request): ResponseInterface
165  {
166  $this->lateBootService->loadExtLocalconfDatabaseAndExtTables();
167  $messageQueue = new FlashMessageQueue('install');
168  $folder = $request->getParsedBody()['install']['folder'];
169  // storageUid is an optional post param if FAL storages should be cleaned
170  $storageUid = $request->getParsedBody()['install']['storageUid'] ?? null;
171  if ($storageUid === null) {
172  $this->typo3tempFileService->clearAssetsFolder($folder);
173  $messageQueue->enqueue(new FlashMessage('The directory "' . $folder . '" has been cleared successfully', 'Directory cleared'));
174  } else {
175  $storageUid = (int)$storageUid;
176  // We have to get the stats before deleting files, otherwise we're not able to retrieve the amount of files anymore
177  $stats = $this->typo3tempFileService->getStatsFromStorageByUid($storageUid);
178  $failedDeletions = $this->typo3tempFileService->clearProcessedFiles($storageUid);
179  if ($failedDeletions) {
180  $messageQueue->enqueue(new FlashMessage(
181  'Failed to delete ' . $failedDeletions . ' processed files. See TYPO3 log (by default typo3temp/var/log/typo3_*.log)',
182  'Failed to delete files',
184  ));
185  } else {
186  $messageQueue->enqueue(new FlashMessage(
187  sprintf('Removed %d files from directory "%s"', $stats['numberOfFiles'], $stats['directory']),
188  'Deleted processed files'
189  ));
190  }
191  }
192  return new JsonResponse([
193  'success' => true,
194  'status' => $messageQueue,
195  ]);
196  }
197 
203  public function ‪dumpAutoloadAction(): ResponseInterface
204  {
205  $messageQueue = new ‪FlashMessageQueue('install');
207  $messageQueue->enqueue(new ‪FlashMessage(
208  'Skipped generating additional class loading information in Composer mode.',
209  'Autoloader not dumped',
211  ));
212  } else {
214  $messageQueue->enqueue(new ‪FlashMessage(
215  'Successfully dumped class loading information for extensions.',
216  'Dumped autoloader'
217  ));
218  }
219  return new ‪JsonResponse([
220  'success' => true,
221  'status' => $messageQueue,
222  ]);
223  }
224 
231  public function ‪databaseAnalyzerAction(ServerRequestInterface $request): ResponseInterface
232  {
233  $view = $this->‪initializeStandaloneView($request, 'Maintenance/DatabaseAnalyzer.html');
234  $formProtection = ‪FormProtectionFactory::get(InstallToolFormProtection::class);
235  $view->assignMultiple([
236  'databaseAnalyzerExecuteToken' => $formProtection->generateToken('installTool', 'databaseAnalyzerExecute'),
237  ]);
238  return new ‪JsonResponse([
239  'success' => true,
240  'html' => $view->render(),
241  'buttons' => [
242  [
243  'btnClass' => 'btn-default t3js-databaseAnalyzer-analyze',
244  'text' => 'Run database compare again',
245  ], [
246  'btnClass' => 'btn-warning t3js-databaseAnalyzer-execute',
247  'text' => 'Apply selected changes',
248  ],
249  ],
250  ]);
251  }
252 
259  public function ‪databaseAnalyzerAnalyzeAction(ServerRequestInterface $request): ResponseInterface
260  {
261  $container = $this->lateBootService->loadExtLocalconfDatabaseAndExtTables();
262  $messageQueue = new FlashMessageQueue('install');
263  $suggestions = [];
264  try {
265  $sqlReader = $container->get(SqlReader::class);
266  $sqlStatements = $sqlReader->getCreateTableStatementArray($sqlReader->getTablesDefinitionString());
267  $schemaMigrationService = GeneralUtility::makeInstance(SchemaMigrator::class);
268  $addCreateChange = $schemaMigrationService->getUpdateSuggestions($sqlStatements);
269 
270  // Aggregate the per-connection statements into one flat array
271  $addCreateChange = array_merge_recursive(...array_values($addCreateChange));
272  if (!empty($addCreateChange['create_table'])) {
273  $suggestion = [
274  'key' => 'addTable',
275  'label' => 'Add tables',
276  'enabled' => true,
277  'children' => [],
278  ];
279  foreach ($addCreateChange['create_table'] as $hash => $statement) {
280  $suggestion['children'][] = [
281  'hash' => $hash,
282  'statement' => $statement,
283  ];
284  }
285  $suggestions[] = $suggestion;
286  }
287  if (!empty($addCreateChange['add'])) {
288  $suggestion = [
289  'key' => 'addField',
290  'label' => 'Add fields to tables',
291  'enabled' => true,
292  'children' => [],
293  ];
294  foreach ($addCreateChange['add'] as $hash => $statement) {
295  $suggestion['children'][] = [
296  'hash' => $hash,
297  'statement' => $statement,
298  ];
299  }
300  $suggestions[] = $suggestion;
301  }
302  if (!empty($addCreateChange['change'])) {
303  $suggestion = [
304  'key' => 'change',
305  'label' => 'Change fields',
306  'enabled' => false,
307  'children' => [],
308  ];
309  foreach ($addCreateChange['change'] as $hash => $statement) {
310  $child = [
311  'hash' => $hash,
312  'statement' => $statement,
313  ];
314  if (isset($addCreateChange['change_currentValue'][$hash])) {
315  $child['current'] = $addCreateChange['change_currentValue'][$hash];
316  }
317  $suggestion['children'][] = $child;
318  }
319  $suggestions[] = $suggestion;
320  }
321 
322  // Difference from current to expected
323  $dropRename = $schemaMigrationService->getUpdateSuggestions($sqlStatements, true);
324 
325  // Aggregate the per-connection statements into one flat array
326  $dropRename = array_merge_recursive(...array_values($dropRename));
327  if (!empty($dropRename['change_table'])) {
328  $suggestion = [
329  'key' => 'renameTableToUnused',
330  'label' => 'Remove tables (rename with prefix)',
331  'enabled' => false,
332  'children' => [],
333  ];
334  foreach ($dropRename['change_table'] as $hash => $statement) {
335  $child = [
336  'hash' => $hash,
337  'statement' => $statement,
338  ];
339  if (!empty($dropRename['tables_count'][$hash])) {
340  $child['rowCount'] = $dropRename['tables_count'][$hash];
341  }
342  $suggestion['children'][] = $child;
343  }
344  $suggestions[] = $suggestion;
345  }
346  if (!empty($dropRename['change'])) {
347  $suggestion = [
348  'key' => 'renameTableFieldToUnused',
349  'label' => 'Remove unused fields (rename with prefix)',
350  'enabled' => false,
351  'children' => [],
352  ];
353  foreach ($dropRename['change'] as $hash => $statement) {
354  $suggestion['children'][] = [
355  'hash' => $hash,
356  'statement' => $statement,
357  ];
358  }
359  $suggestions[] = $suggestion;
360  }
361  if (!empty($dropRename['drop'])) {
362  $suggestion = [
363  'key' => 'deleteField',
364  'label' => 'Drop fields (really!)',
365  'enabled' => false,
366  'children' => [],
367  ];
368  foreach ($dropRename['drop'] as $hash => $statement) {
369  $suggestion['children'][] = [
370  'hash' => $hash,
371  'statement' => $statement,
372  ];
373  }
374  $suggestions[] = $suggestion;
375  }
376  if (!empty($dropRename['drop_table'])) {
377  $suggestion = [
378  'key' => 'deleteTable',
379  'label' => 'Drop tables (really!)',
380  'enabled' => false,
381  'children' => [],
382  ];
383  foreach ($dropRename['drop_table'] as $hash => $statement) {
384  $child = [
385  'hash' => $hash,
386  'statement' => $statement,
387  ];
388  if (!empty($dropRename['tables_count'][$hash])) {
389  $child['rowCount'] = $dropRename['tables_count'][$hash];
390  }
391  $suggestion['children'][] = $child;
392  }
393  $suggestions[] = $suggestion;
394  }
395  } catch (StatementException $e) {
396  $messageQueue->enqueue(new FlashMessage(
397  $e->getMessage(),
398  'Database analysis failed',
400  ));
401  }
402  return new JsonResponse([
403  'success' => true,
404  'status' => $messageQueue,
405  'suggestions' => $suggestions,
406  ]);
407  }
408 
415  public function ‪databaseAnalyzerExecuteAction(ServerRequestInterface $request): ResponseInterface
416  {
417  $container = $this->lateBootService->loadExtLocalconfDatabaseAndExtTables();
418  $messageQueue = new FlashMessageQueue('install');
419  $selectedHashes = $request->getParsedBody()['install']['hashes'] ?? [];
420  if (empty($selectedHashes)) {
421  $messageQueue->enqueue(new FlashMessage(
422  'Please select any change by activating their respective checkboxes.',
423  'No database changes selected',
425  ));
426  } else {
427  $sqlReader = $container->get(SqlReader::class);
428  $sqlStatements = $sqlReader->getCreateTableStatementArray($sqlReader->getTablesDefinitionString());
429  $schemaMigrationService = GeneralUtility::makeInstance(SchemaMigrator::class);
430  $statementHashesToPerform = array_flip($selectedHashes);
431  $results = $schemaMigrationService->migrate($sqlStatements, $statementHashesToPerform);
432  // Create error flash messages if any
433  foreach ($results as $errorMessage) {
434  $messageQueue->enqueue(new FlashMessage(
435  'Error: ' . $errorMessage,
436  'Database update failed',
438  ));
439  }
440  $messageQueue->enqueue(new FlashMessage(
441  'Executed database updates',
442  'Executed database updates'
443  ));
444  }
445  return new JsonResponse([
446  'success' => true,
447  'status' => $messageQueue,
448  ]);
449  }
450 
457  public function ‪clearTablesStatsAction(ServerRequestInterface $request): ResponseInterface
458  {
459  $view = $this->‪initializeStandaloneView($request, 'Maintenance/ClearTables.html');
460  $formProtection = ‪FormProtectionFactory::get(InstallToolFormProtection::class);
461  $view->assignMultiple([
462  'clearTablesClearToken' => $formProtection->generateToken('installTool', 'clearTablesClear'),
463  ]);
464  return new JsonResponse([
465  'success' => true,
466  'stats' => (new ClearTableService())->getTableStatistics(),
467  'html' => $view->render(),
468  'buttons' => [
469  [
470  'btnClass' => 'btn-default t3js-clearTables-stats',
471  'text' => 'Scan again',
472  ],
473  ],
474  ]);
475  }
476 
484  public function ‪clearTablesClearAction(ServerRequestInterface $request): ResponseInterface
485  {
486  $table = $request->getParsedBody()['install']['table'];
487  if (empty($table)) {
488  throw new \RuntimeException(
489  'No table name given',
490  1501944076
491  );
492  }
493  (new ClearTableService())->clearSelectedTable($table);
494  $messageQueue = (new FlashMessageQueue('install'))->enqueue(
495  new FlashMessage('The table ' . $table . ' has been cleared.', 'Table cleared')
496  );
497  return new JsonResponse([
498  'success' => true,
499  'status' => $messageQueue
500  ]);
501  }
508  public function ‪createAdminGetDataAction(ServerRequestInterface $request): ResponseInterface
509  {
510  $view = $this->‪initializeStandaloneView($request, 'Maintenance/CreateAdmin.html');
511  $formProtection = ‪FormProtectionFactory::get(InstallToolFormProtection::class);
512  $view->assignMultiple([
513  'createAdminToken' => $formProtection->generateToken('installTool', 'createAdmin'),
514  ]);
515  return new JsonResponse([
516  'success' => true,
517  'html' => $view->render(),
518  'buttons' => [
519  [
520  'btnClass' => 'btn-default t3js-createAdmin-create',
521  'text' => 'Create administrator user',
522  ],
523  ],
524  ]);
525  }
526 
533  public function ‪createAdminAction(ServerRequestInterface $request): ResponseInterface
534  {
535  $username = preg_replace('/\\s/i', '', $request->getParsedBody()['install']['userName']);
536  $password = $request->getParsedBody()['install']['userPassword'];
537  $passwordCheck = $request->getParsedBody()['install']['userPasswordCheck'];
538  $email = $request->getParsedBody()['install']['userEmail'] ?? '';
539  $isSystemMaintainer = ((bool)$request->getParsedBody()['install']['userSystemMaintainer'] == '1') ? true : false;
540 
541  $messages = new FlashMessageQueue('install');
542 
543  if ($username === '') {
544  $messages->enqueue(new FlashMessage(
545  'No username given.',
546  'Administrator user not created',
548  ));
549  } elseif ($password !== $passwordCheck) {
550  $messages->enqueue(new FlashMessage(
551  'Passwords do not match.',
552  'Administrator user not created',
554  ));
555  } elseif (strlen($password) < 8) {
556  $messages->enqueue(new FlashMessage(
557  'Password must be at least eight characters long.',
558  'Administrator user not created',
560  ));
561  } else {
562  $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
563  $userExists = $connectionPool->getConnectionForTable('be_users')
564  ->count(
565  'uid',
566  'be_users',
567  ['username' => $username]
568  );
569  if ($userExists) {
570  $messages->enqueue(new FlashMessage(
571  'A user with username "' . $username . '" exists already.',
572  'Administrator user not created',
574  ));
575  } else {
576  $hashInstance = $this->passwordHashFactory->getDefaultHashInstance('BE');
577  $hashedPassword = $hashInstance->getHashedPassword($password);
578  $adminUserFields = [
579  'username' => $username,
580  'password' => $hashedPassword,
581  'admin' => 1,
582  'tstamp' => ‪$GLOBALS['EXEC_TIME'],
583  'crdate' => ‪$GLOBALS['EXEC_TIME']
584  ];
585  if (GeneralUtility::validEmail($email)) {
586  $adminUserFields['email'] = $email;
587  }
588  $connectionPool->getConnectionForTable('be_users')->insert('be_users', $adminUserFields);
589 
590  if ($isSystemMaintainer) {
591 
592  // Get the new admin user uid just created
593  $newAdminUserUid = (int)$connectionPool->getConnectionForTable('be_users')->lastInsertId('be_users');
594 
595  // Get the list of the existing systemMaintainer
596  $existingSystemMaintainersList = ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['systemMaintainers'] ?? [];
597 
598  // Add the new admin user to the existing systemMaintainer list
599  $newSystemMaintainersList = $existingSystemMaintainersList;
600  $newSystemMaintainersList[] = $newAdminUserUid;
601 
602  // Update the LocalConfiguration.php file with the new list
603  $this->configurationManager->setLocalConfigurationValuesByPathValuePairs(
604  ['SYS/systemMaintainers' => $newSystemMaintainersList]
605  );
606  }
607 
608  $messages->enqueue(new FlashMessage(
609  'Administrator created',
610  'An administrator with username "' . $username . '" has been created successfully.'
611  ));
612  }
613  }
614  return new JsonResponse([
615  'success' => true,
616  'status' => $messages,
617  ]);
618  }
619 
628  public function ‪languagePacksGetDataAction(ServerRequestInterface $request): ResponseInterface
629  {
630  $view = $this->‪initializeStandaloneView($request, 'Maintenance/LanguagePacks.html');
631  $formProtection = ‪FormProtectionFactory::get(InstallToolFormProtection::class);
632  $view->assignMultiple([
633  'languagePacksActivateLanguageToken' => $formProtection->generateToken('installTool', 'languagePacksActivateLanguage'),
634  'languagePacksDeactivateLanguageToken' => $formProtection->generateToken('installTool', 'languagePacksDeactivateLanguage'),
635  'languagePacksUpdatePackToken' => $formProtection->generateToken('installTool', 'languagePacksUpdatePack'),
636  'languagePacksUpdateIsoTimesToken' => $formProtection->generateToken('installTool', 'languagePacksUpdateIsoTimes'),
637  ]);
638  // This action needs TYPO3_CONF_VARS for full GeneralUtility::getUrl() config
639  $container = $this->lateBootService->loadExtLocalconfDatabaseAndExtTables(false);
640  $languagePackService = $container->get(LanguagePackService::class);
641  $languagePackService->updateMirrorBaseUrl();
642  $extensions = $languagePackService->getExtensionLanguagePackDetails();
643  return new JsonResponse([
644  'success' => true,
645  'languages' => $languagePackService->getLanguageDetails(),
646  'extensions' => $extensions,
647  'activeLanguages' => $languagePackService->getActiveLanguages(),
648  'activeExtensions' => array_column($extensions, 'key'),
649  'html' => $view->render(),
650  ]);
651  }
652 
659  public function ‪languagePacksActivateLanguageAction(ServerRequestInterface $request): ResponseInterface
660  {
661  $messageQueue = new FlashMessageQueue('install');
662  $languagePackService = GeneralUtility::makeInstance(LanguagePackService::class);
663  $availableLanguages = $languagePackService->getAvailableLanguages();
664  $activeLanguages = $languagePackService->getActiveLanguages();
665  $iso = $request->getParsedBody()['install']['iso'];
666  $activateArray = [];
667  foreach ($availableLanguages as $availableIso => $name) {
668  if ($availableIso === $iso && !in_array($availableIso, $activeLanguages, true)) {
669  $activateArray[] = $iso;
670  $dependencies = $this->locales->getLocaleDependencies($availableIso);
671  if (!empty($dependencies)) {
672  foreach ($dependencies as $dependency) {
673  if (!in_array($dependency, $activeLanguages, true)) {
674  $activateArray[] = $dependency;
675  }
676  }
677  }
678  }
679  }
680  if (!empty($activateArray)) {
681  $activeLanguages = array_merge($activeLanguages, $activateArray);
682  sort($activeLanguages);
683  $this->configurationManager->setLocalConfigurationValueByPath(
684  'EXTCONF/lang',
685  ['availableLanguages' => $activeLanguages]
686  );
687  $activationArray = [];
688  foreach ($activateArray as $activateIso) {
689  $activationArray[] = $availableLanguages[$activateIso] . ' (' . $activateIso . ')';
690  }
691  $messageQueue->enqueue(
692  new FlashMessage(
693  'These languages have been activated: ' . implode(', ', $activationArray)
694  )
695  );
696  } else {
697  $messageQueue->enqueue(
698  new FlashMessage('Language with ISO code "' . $iso . '" not found or already active.', '', ‪FlashMessage::ERROR)
699  );
700  }
701  return new JsonResponse([
702  'success' => true,
703  'status' => $messageQueue,
704  ]);
705  }
706 
714  public function ‪languagePacksDeactivateLanguageAction(ServerRequestInterface $request): ResponseInterface
715  {
716  $messageQueue = new FlashMessageQueue('install');
717  $languagePackService = GeneralUtility::makeInstance(LanguagePackService::class);
718  $availableLanguages = $languagePackService->getAvailableLanguages();
719  $activeLanguages = $languagePackService->getActiveLanguages();
720  $iso = $request->getParsedBody()['install']['iso'];
721  if (empty($iso)) {
722  throw new \RuntimeException('No iso code given', 1520109807);
723  }
724  $otherActiveLanguageDependencies = [];
725  foreach ($activeLanguages as $activeLanguage) {
726  if ($activeLanguage === $iso) {
727  continue;
728  }
729  $dependencies = $this->locales->getLocaleDependencies($activeLanguage);
730  if (in_array($iso, $dependencies, true)) {
731  $otherActiveLanguageDependencies[] = $activeLanguage;
732  }
733  }
734  if (!empty($otherActiveLanguageDependencies)) {
735  // Error: Must disable dependencies first
736  $dependentArray = [];
737  foreach ($otherActiveLanguageDependencies as $dependency) {
738  $dependentArray[] = $availableLanguages[$dependency] . ' (' . $dependency . ')';
739  }
740  $messageQueue->enqueue(
741  new FlashMessage(
742  'Language "' . $availableLanguages[$iso] . ' (' . $iso . ')" can not be deactivated. These'
743  . ' other languages depend on it and need to be deactivated before:'
744  . implode(', ', $dependentArray),
745  '',
747  )
748  );
749  } else {
750  if (in_array($iso, $activeLanguages, true)) {
751  // Deactivate this language
752  $newActiveLanguages = [];
753  foreach ($activeLanguages as $activeLanguage) {
754  if ($activeLanguage === $iso) {
755  continue;
756  }
757  $newActiveLanguages[] = $activeLanguage;
758  }
759  $this->configurationManager->setLocalConfigurationValueByPath(
760  'EXTCONF/lang',
761  ['availableLanguages' => $newActiveLanguages]
762  );
763  $messageQueue->enqueue(
764  new FlashMessage(
765  'Language "' . $availableLanguages[$iso] . ' (' . $iso . ')" has been deactivated'
766  )
767  );
768  } else {
769  $messageQueue->enqueue(
770  new FlashMessage(
771  'Language "' . $availableLanguages[$iso] . ' (' . $iso . ')" has not been deactivated',
772  '',
774  )
775  );
776  }
777  }
778  return new JsonResponse([
779  'success' => true,
780  'status' => $messageQueue,
781  ]);
782  }
783 
791  public function ‪languagePacksUpdatePackAction(ServerRequestInterface $request): ResponseInterface
792  {
793  $container = $this->lateBootService->loadExtLocalconfDatabaseAndExtTables(false);
794  $iso = $request->getParsedBody()['install']['iso'];
795  $key = $request->getParsedBody()['install']['extension'];
796 
797  $languagePackService = $container->get(LanguagePackService::class);
798 
799  return new JsonResponse([
800  'success' => true,
801  'packResult' => $languagePackService->languagePackDownload($key, $iso)
802  ]);
803  }
804 
811  public function ‪languagePacksUpdateIsoTimesAction(ServerRequestInterface $request): ResponseInterface
812  {
813  $isos = $request->getParsedBody()['install']['isos'];
814  $languagePackService = GeneralUtility::makeInstance(LanguagePackService::class);
815  $languagePackService->setLastUpdatedIsoCode($isos);
816 
817  // The cache manager is already instantiated in the install tool
818  // with some hacked settings to disable caching of extbase and fluid.
819  // We want a "fresh" object here to operate on a different cache setup.
820  // cacheManager implements SingletonInterface, so the only way to get a "fresh"
821  // instance is by circumventing makeInstance and/or the objectManager and
822  // using new directly!
823  $cacheManager = new CacheManager();
824  $cacheManager->setCacheConfigurations(‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']);
825  $cacheManager->getCache('l10n')->flush();
826 
827  return new JsonResponse(['success' => true]);
828  }
829 
835  public function ‪resetBackendUserUcAction(): ResponseInterface
836  {
837  GeneralUtility::makeInstance(ConnectionPool::class)
838  ->getQueryBuilderForTable('be_users')
839  ->update('be_users')
840  ->set('uc', '')
841  ->execute();
842  $messageQueue = new ‪FlashMessageQueue('install');
843  $messageQueue->enqueue(new ‪FlashMessage(
844  'Preferences of all backend users have been reset',
845  'Reset preferences of all backend users'
846  ));
847  return new ‪JsonResponse([
848  'success' => true,
849  'status' => $messageQueue
850  ]);
851  }
852 }
‪TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory
Definition: PasswordHashFactory.php:27
‪TYPO3\CMS\Install\Controller\AbstractController\initializeStandaloneView
‪StandaloneView initializeStandaloneView(ServerRequestInterface $request, string $templatePath)
Definition: AbstractController.php:40
‪TYPO3\CMS\Core\FormProtection\FormProtectionFactory\get
‪static TYPO3 CMS Core FormProtection AbstractFormProtection get($classNameOrType='default',... $constructorArguments)
Definition: FormProtectionFactory.php:74
‪TYPO3\CMS\Core\Database\Schema\Exception\StatementException
Definition: StatementException.php:24
‪TYPO3\CMS\Install\Controller\MaintenanceController\$clearCacheService
‪ClearCacheService $clearCacheService
Definition: MaintenanceController.php:57
‪TYPO3\CMS\Install\Controller\MaintenanceController\dumpAutoloadAction
‪ResponseInterface dumpAutoloadAction()
Definition: MaintenanceController.php:197
‪TYPO3\CMS\Install\Controller\MaintenanceController\clearTypo3tempFilesStatsAction
‪ResponseInterface clearTypo3tempFilesStatsAction(ServerRequestInterface $request)
Definition: MaintenanceController.php:129
‪TYPO3\CMS\Install\Controller\MaintenanceController\__construct
‪__construct(LateBootService $lateBootService, ClearCacheService $clearCacheService, Typo3tempFileService $typo3tempFileService, ConfigurationManager $configurationManager, PasswordHashFactory $passwordHashFactory, Locales $locales)
Definition: MaintenanceController.php:75
‪TYPO3\CMS\Install\Controller\MaintenanceController\$typo3tempFileService
‪Typo3tempFileService $typo3tempFileService
Definition: MaintenanceController.php:61
‪TYPO3\CMS\Install\Controller\MaintenanceController\createAdminGetDataAction
‪ResponseInterface createAdminGetDataAction(ServerRequestInterface $request)
Definition: MaintenanceController.php:502
‪TYPO3\CMS\Install\Controller\MaintenanceController\languagePacksGetDataAction
‪ResponseInterface languagePacksGetDataAction(ServerRequestInterface $request)
Definition: MaintenanceController.php:622
‪TYPO3\CMS\Install\Controller\MaintenanceController\databaseAnalyzerExecuteAction
‪ResponseInterface databaseAnalyzerExecuteAction(ServerRequestInterface $request)
Definition: MaintenanceController.php:409
‪TYPO3\CMS\Core\Core\ClassLoadingInformation\dumpClassLoadingInformation
‪static dumpClassLoadingInformation()
Definition: ClassLoadingInformation.php:90
‪TYPO3\CMS\Install\Controller\MaintenanceController\clearTypo3tempFilesAction
‪ResponseInterface clearTypo3tempFilesAction(ServerRequestInterface $request)
Definition: MaintenanceController.php:158
‪TYPO3\CMS\Install\Service\Typo3tempFileService
Definition: Typo3tempFileService.php:32
‪TYPO3\CMS\Core\Core\ClassLoadingInformation
Definition: ClassLoadingInformation.php:35
‪TYPO3\CMS\Install\Controller\MaintenanceController\databaseAnalyzerAnalyzeAction
‪ResponseInterface databaseAnalyzerAnalyzeAction(ServerRequestInterface $request)
Definition: MaintenanceController.php:253
‪TYPO3\CMS\Install\Controller\MaintenanceController\clearTablesStatsAction
‪ResponseInterface clearTablesStatsAction(ServerRequestInterface $request)
Definition: MaintenanceController.php:451
‪TYPO3\CMS\Install\Controller\MaintenanceController\cardsAction
‪ResponseInterface cardsAction(ServerRequestInterface $request)
Definition: MaintenanceController.php:96
‪TYPO3\CMS\Core\Localization\Locales
Definition: Locales.php:30
‪TYPO3\CMS\Core\Database\Schema\SqlReader
Definition: SqlReader.php:31
‪TYPO3\CMS\Install\Controller\MaintenanceController\languagePacksDeactivateLanguageAction
‪ResponseInterface languagePacksDeactivateLanguageAction(ServerRequestInterface $request)
Definition: MaintenanceController.php:708
‪TYPO3\CMS\Core\Database\Schema\SchemaMigrator
Definition: SchemaMigrator.php:36
‪TYPO3\CMS\Install\Service\ClearTableService
Definition: ClearTableService.php:29
‪TYPO3\CMS\Core\FormProtection\InstallToolFormProtection
Definition: InstallToolFormProtection.php:61
‪TYPO3\CMS\Install\Controller\MaintenanceController\databaseAnalyzerAction
‪ResponseInterface databaseAnalyzerAction(ServerRequestInterface $request)
Definition: MaintenanceController.php:225
‪TYPO3\CMS\Install\Controller\MaintenanceController\languagePacksActivateLanguageAction
‪ResponseInterface languagePacksActivateLanguageAction(ServerRequestInterface $request)
Definition: MaintenanceController.php:653
‪TYPO3\CMS\Core\Messaging\AbstractMessage\WARNING
‪const WARNING
Definition: AbstractMessage.php:30
‪TYPO3\CMS\Install\Controller\MaintenanceController\cacheClearAllAction
‪ResponseInterface cacheClearAllAction()
Definition: MaintenanceController.php:110
‪TYPO3\CMS\Install\Controller
Definition: AbstractController.php:18
‪TYPO3\CMS\Install\Controller\MaintenanceController\$configurationManager
‪ConfigurationManager $configurationManager
Definition: MaintenanceController.php:65
‪TYPO3\CMS\Install\Controller\MaintenanceController\languagePacksUpdateIsoTimesAction
‪ResponseInterface languagePacksUpdateIsoTimesAction(ServerRequestInterface $request)
Definition: MaintenanceController.php:805
‪TYPO3\CMS\Install\Controller\MaintenanceController\$locales
‪Locales $locales
Definition: MaintenanceController.php:73
‪TYPO3\CMS\Install\Controller\MaintenanceController\$passwordHashFactory
‪PasswordHashFactory $passwordHashFactory
Definition: MaintenanceController.php:69
‪TYPO3\CMS\Core\Cache\CacheManager
Definition: CacheManager.php:35
‪TYPO3\CMS\Install\Service\LateBootService
Definition: LateBootService.php:34
‪TYPO3\CMS\Install\Controller\MaintenanceController\createAdminAction
‪ResponseInterface createAdminAction(ServerRequestInterface $request)
Definition: MaintenanceController.php:527
‪TYPO3\CMS\Core\Service\OpcodeCacheService
Definition: OpcodeCacheService.php:25
‪TYPO3\CMS\Install\Service\LanguagePackService
Definition: LanguagePackService.php:42
‪TYPO3\CMS\Core\Core\Environment\isComposerMode
‪static bool isComposerMode()
Definition: Environment.php:144
‪TYPO3\CMS\Core\Messaging\FlashMessage
Definition: FlashMessage.php:24
‪TYPO3\CMS\Core\FormProtection\FormProtectionFactory
Definition: FormProtectionFactory.php:47
‪TYPO3\CMS\Core\Http\JsonResponse
Definition: JsonResponse.php:26
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:40
‪TYPO3\CMS\Install\Controller\MaintenanceController
Definition: MaintenanceController.php:50
‪TYPO3\CMS\Install\Controller\AbstractController
Definition: AbstractController.php:31
‪TYPO3\CMS\Core\Messaging\AbstractMessage\NOTICE
‪const NOTICE
Definition: AbstractMessage.php:27
‪TYPO3\CMS\Install\Controller\MaintenanceController\$lateBootService
‪LateBootService $lateBootService
Definition: MaintenanceController.php:53
‪TYPO3\CMS\Install\Controller\MaintenanceController\languagePacksUpdatePackAction
‪ResponseInterface languagePacksUpdatePackAction(ServerRequestInterface $request)
Definition: MaintenanceController.php:785
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:46
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Core\Messaging\FlashMessageQueue
Definition: FlashMessageQueue.php:29
‪TYPO3\CMS\Install\Service\ClearCacheService
Definition: ClearCacheService.php:29
‪TYPO3\CMS\Install\Controller\MaintenanceController\resetBackendUserUcAction
‪ResponseInterface resetBackendUserUcAction()
Definition: MaintenanceController.php:829
‪TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR
‪const ERROR
Definition: AbstractMessage.php:31
‪TYPO3\CMS\Install\Controller\MaintenanceController\clearTablesClearAction
‪ResponseInterface clearTablesClearAction(ServerRequestInterface $request)
Definition: MaintenanceController.php:478