‪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;
26 
32 {
33  public function ‪__construct(
34  private readonly ‪FormProtectionFactory $formProtectionFactory
35  ) {
36  }
37 
41  public function ‪showEnableInstallToolFileAction(ServerRequestInterface $request): ResponseInterface
42  {
43  $view = $this->‪initializeView($request);
45  $view->assign('enableInstallToolPath', $path);
46  return new ‪JsonResponse([
47  'success' => true,
48  'html' => $view->render('Login/ShowEnableInstallToolFile'),
49  ]);
50  }
51 
55  public function ‪showLoginAction(ServerRequestInterface $request): ResponseInterface
56  {
57  $formProtection = $this->formProtectionFactory->createFromRequest($request);
58  $view = $this->‪initializeView($request);
59  $view->assignMultiple([
60  'siteName' => ‪$GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'],
61  'loginToken' => $formProtection->generateToken('installTool', 'login'),
62  'installToolEnableFilePermanent' => ‪EnableFileService::isInstallToolEnableFilePermanent(),
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:55
‪TYPO3\CMS\Core\Core\Environment\getPublicPath
‪static getPublicPath()
Definition: Environment.php:187
‪TYPO3\CMS\Install\Service\EnableFileService
Definition: EnableFileService.php:26
‪TYPO3\CMS\Install\Controller\LoginController\__construct
‪__construct(private readonly FormProtectionFactory $formProtectionFactory)
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:44
‪TYPO3\CMS\Core\Http\JsonResponse
Definition: JsonResponse.php:28
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\Core\Environment
Definition: Environment.php:41
‪TYPO3\CMS\Install\Controller\LoginController\showEnableInstallToolFileAction
‪showEnableInstallToolFileAction(ServerRequestInterface $request)
Definition: LoginController.php:41
‪TYPO3\CMS\Install\Controller\AbstractController
Definition: AbstractController.php:35
‪TYPO3\CMS\Install\Service\EnableFileService\getBestLocationForInstallToolEnableFile
‪static getBestLocationForInstallToolEnableFile()
Definition: EnableFileService.php:161