‪TYPO3CMS  ‪main
LoginController.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;
22 use TYPO3\CMS\Core\Configuration\ConfigurationManager;
26 
32 {
33  public function ‪__construct(
34  private readonly ‪FormProtectionFactory $formProtectionFactory,
35  private readonly ConfigurationManager $configurationManager,
36  ) {}
37 
41  public function ‪showEnableInstallToolFileAction(ServerRequestInterface $request): ResponseInterface
42  {
43  $view = $this->‪initializeView($request);
44  $view->assign('enableInstallToolPath', ‪EnableFileService::getStaticLocationForInstallToolEnableFileDirectory());
45  return new ‪JsonResponse([
46  'success' => true,
47  'html' => $view->render('Login/ShowEnableInstallToolFile'),
48  ]);
49  }
50 
54  public function ‪showLoginAction(ServerRequestInterface $request): ResponseInterface
55  {
56  $formProtection = $this->formProtectionFactory->createFromRequest($request);
57  $view = $this->‪initializeView($request);
58  $view->assignMultiple([
59  'siteName' => ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'],
60  'loginToken' => $formProtection->generateToken('installTool', 'login'),
61  'installToolEnableFilePermanent' => ‪EnableFileService::isInstallToolEnableFilePermanent(),
62  'configFile' => $this->configurationManager->getSystemConfigurationFileLocation(true),
63  ]);
64  return new ‪JsonResponse([
65  'success' => true,
66  'html' => $view->render('Login/ShowLogin'),
67  ]);
68  }
69 }
‪TYPO3\CMS\Install\Controller\LoginController\showLoginAction
‪showLoginAction(ServerRequestInterface $request)
Definition: LoginController.php:54
‪TYPO3\CMS\Install\Service\EnableFileService
Definition: EnableFileService.php:26
‪TYPO3\CMS\Install\Service\EnableFileService\getStaticLocationForInstallToolEnableFileDirectory
‪static getStaticLocationForInstallToolEnableFileDirectory()
Definition: EnableFileService.php:165
‪TYPO3\CMS\Install\Controller\LoginController\__construct
‪__construct(private readonly FormProtectionFactory $formProtectionFactory, private readonly ConfigurationManager $configurationManager,)
Definition: LoginController.php:33
‪TYPO3\CMS\Install\Controller\LoginController
Definition: LoginController.php:32
‪TYPO3\CMS\Install\Controller
Definition: AbstractController.php:18
‪TYPO3\CMS\Install\Service\EnableFileService\isInstallToolEnableFilePermanent
‪static isInstallToolEnableFilePermanent()
Definition: EnableFileService.php:121
‪TYPO3\CMS\Install\Controller\AbstractController\initializeView
‪initializeView(ServerRequestInterface $request)
Definition: AbstractController.php:39
‪TYPO3\CMS\Core\FormProtection\FormProtectionFactory
Definition: FormProtectionFactory.php:43
‪TYPO3\CMS\Core\Http\JsonResponse
Definition: JsonResponse.php:28
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Install\Controller\LoginController\showEnableInstallToolFileAction
‪showEnableInstallToolFileAction(ServerRequestInterface $request)
Definition: LoginController.php:41
‪TYPO3\CMS\Install\Controller\AbstractController
Definition: AbstractController.php:35