‪TYPO3CMS  9.5
AdminPanelInitiator.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
3 
5 
6 /*
7  * This file is part of the TYPO3 CMS project.
8  *
9  * It is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License, either version 2
11  * of the License, or any later version.
12  *
13  * For the full copyright and license information, please read the
14  * LICENSE.txt file that was distributed with this source code.
15  *
16  * The TYPO3 project - inspiring people to share!
17  */
18 
19 use Psr\Http\Message\ResponseInterface;
20 use Psr\Http\Message\ServerRequestInterface;
21 use Psr\Http\Server\MiddlewareInterface;
22 use Psr\Http\Server\RequestHandlerInterface;
27 
33 class ‪AdminPanelInitiator implements MiddlewareInterface
34 {
45  public function ‪process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
46  {
48  $request = $request->withAttribute('adminPanelRequestId', substr(md5(uniqid('', true)), 0, 13));
49  $adminPanelController = GeneralUtility::makeInstance(
50  MainController::class
51  );
52  $adminPanelController->initialize($request);
53  // legacy handling
54  $beUser = ‪$GLOBALS['BE_USER'];
55  $beUser->adminPanel = GeneralUtility::makeInstance(AdminPanelView::class);
56  $beUser->extAdmEnabled = true;
57  }
58  return $handler->handle($request);
59  }
60 }
‪TYPO3\CMS\Adminpanel\Controller\MainController
Definition: MainController.php:45
‪TYPO3\CMS\Adminpanel\Middleware
Definition: AdminPanelDataPersister.php:4
‪TYPO3\CMS\Adminpanel\Middleware\AdminPanelInitiator
Definition: AdminPanelInitiator.php:34
‪TYPO3\CMS\Adminpanel\Utility\StateUtility\isActivatedForUser
‪static bool isActivatedForUser()
Definition: StateUtility.php:33
‪TYPO3\CMS\Adminpanel\View\AdminPanelView
Definition: AdminPanelView.php:34
‪TYPO3\CMS\Adminpanel\Utility\StateUtility
Definition: StateUtility.php:27
‪TYPO3\CMS\Adminpanel\Middleware\AdminPanelInitiator\process
‪ResponseInterface process(ServerRequestInterface $request, RequestHandlerInterface $handler)
Definition: AdminPanelInitiator.php:45
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Adminpanel\Utility\StateUtility\isOpen
‪static bool isOpen()
Definition: StateUtility.php:54
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45