‪TYPO3CMS  10.4
AbstractLoginFormController.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 
24 
26 {
32  protected function ‪getStorageFolders(): array
33  {
34  if ((bool)(‪$GLOBALS['TYPO3_CONF_VARS']['FE']['checkFeUserPid'] ?? false) === false) {
35  return [0];
36  }
37  $storagePids = explode(',', $this->settings['pages'] ?? '');
38  $storagePids = array_map('intval', $storagePids);
39 
40  $recursionDepth = (int)($this->settings['recursive'] ?? 0);
41  if ($recursionDepth > 0) {
42  $recursiveStoragePids = $storagePids;
43  foreach ($storagePids as $startPid) {
44  $pids = $this->configurationManager->getContentObject()->getTreeList($startPid, $recursionDepth);
45  foreach (‪GeneralUtility::intExplode(',', $pids, true) as $pid) {
46  $recursiveStoragePids[] = $pid;
47  }
48  }
49  $storagePids = $recursiveStoragePids;
50  }
51 
52  return array_unique($storagePids);
53  }
54 
55  protected function ‪getSignedStorageFolders(): string
56  {
57  $pidList = implode(',', $this->‪getStorageFolders());
58  return sprintf(
59  '%s@%s',
60  $pidList,
61  GeneralUtility::hmac($pidList, FrontendUserAuthentication::class)
62  );
63  }
64 
65  protected function ‪shallEnforceLoginSigning(): bool
66  {
67  return GeneralUtility::makeInstance(Features::class)
68  ->isFeatureEnabled('security.frontend.enforceLoginSigning');
69  }
70 }
‪TYPO3\CMS\FrontendLogin\Controller\AbstractLoginFormController
Definition: AbstractLoginFormController.php:26
‪TYPO3\CMS\FrontendLogin\Controller
Definition: AbstractLoginFormController.php:18
‪TYPO3\CMS\FrontendLogin\Controller\AbstractLoginFormController\shallEnforceLoginSigning
‪shallEnforceLoginSigning()
Definition: AbstractLoginFormController.php:65
‪TYPO3\CMS\FrontendLogin\Controller\AbstractLoginFormController\getStorageFolders
‪array getStorageFolders()
Definition: AbstractLoginFormController.php:32
‪TYPO3\CMS\Core\Configuration\Features
Definition: Features.php:56
‪TYPO3\CMS\FrontendLogin\Controller\AbstractLoginFormController\getSignedStorageFolders
‪getSignedStorageFolders()
Definition: AbstractLoginFormController.php:55
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Extbase\Mvc\Controller\ActionController
Definition: ActionController.php:55
‪TYPO3\CMS\Core\Utility\GeneralUtility\intExplode
‪static int[] intExplode($delimiter, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:988
‪TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication
Definition: FrontendUserAuthentication.php:30
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46