‪TYPO3CMS  11.5
UsernamePasswordLoginProvider.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
20 use TYPO3\CMS\Core\Page\PageRenderer;
23 
29 {
36  public function ‪render(‪StandaloneView $view, PageRenderer $pageRenderer, ‪LoginController $loginController)
37  {
38  $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/UserPassLogin');
39 
40  $view->‪setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/UserPassLoginForm.html'));
41  $request = $loginController->‪getCurrentRequest();
42  if ($request !== null && $request->getAttribute('normalizedParams')->isHttps()) {
43  $username = $request->getParsedBody()['u'] ?? $request->getQueryParams()['u'] ?? null;
44  $password = $request->getParsedBody()['p'] ?? $request->getQueryParams()['p'] ?? null;
45  $view->‪assignMultiple([
46  'presetUsername' => $username,
47  'presetPassword' => $password,
48  ]);
49  }
50 
51  $view->‪assign('enablePasswordReset', GeneralUtility::makeInstance(PasswordReset::class)->isEnabled());
52  }
53 }
‪TYPO3\CMS\Backend\LoginProvider\LoginProviderInterface
Definition: LoginProviderInterface.php:26
‪TYPO3\CMS\Extbase\Mvc\View\ViewInterface\assign
‪self assign($key, $value)
‪TYPO3\CMS\Backend\Authentication\PasswordReset
Definition: PasswordReset.php:59
‪TYPO3\CMS\Backend\Controller\LoginController\getCurrentRequest
‪getCurrentRequest()
Definition: LoginController.php:513
‪TYPO3\CMS\Backend\LoginProvider\UsernamePasswordLoginProvider\render
‪render(StandaloneView $view, PageRenderer $pageRenderer, LoginController $loginController)
Definition: UsernamePasswordLoginProvider.php:36
‪TYPO3\CMS\Fluid\View\AbstractTemplateView\setTemplatePathAndFilename
‪setTemplatePathAndFilename($templatePathAndFilename)
Definition: AbstractTemplateView.php:113
‪TYPO3\CMS\Backend\LoginProvider\UsernamePasswordLoginProvider
Definition: UsernamePasswordLoginProvider.php:29
‪TYPO3\CMS\Extbase\Mvc\View\ViewInterface\assignMultiple
‪self assignMultiple(array $values)
‪TYPO3\CMS\Fluid\View\StandaloneView
Definition: StandaloneView.php:31
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:50
‪TYPO3\CMS\Backend\Controller\LoginController
Definition: LoginController.php:54
‪TYPO3\CMS\Backend\LoginProvider