2 declare(strict_types = 1);
18 use Psr\Http\Message\ResponseInterface;
19 use Psr\Http\Message\ServerRequestInterface;
20 use Psr\Http\Server\MiddlewareInterface;
21 use Psr\Http\Server\RequestHandlerInterface;
45 public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
49 if (!empty($redirectToUri)) {
55 if (strpos($request->getHeaderLine(
'Accept'),
'application/json') !==
false) {
58 'will_time_out' =>
false,
60 'message' => $e->getMessage()
67 $request->getAttribute(
'normalizedParams')->getRemoteAddress(),
68 trim((
string)
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'IPmaskList'])
71 return $handler->handle($request);
82 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'adminOnly'] < 0) {
83 throw new BackendLockedException(
'TYPO3 Backend locked: Backend and Install Tool are locked for maintenance. [BE][adminOnly] is set to "' . (
int)
$GLOBALS[
'TYPO3_CONF_VARS'][
'BE'][
'adminOnly'] .
'".', 1517949794);
90 throw new BackendLockedException(
'TYPO3 Backend locked: Browser backend is locked for maintenance. Remove lock by removing the file "typo3conf/LOCK_BACKEND" or use CLI-scripts.', 1517949793);
103 if ($ipMaskList !==
'' && !GeneralUtility::cmpIP($ipAddress, $ipMaskList)) {
104 throw new \RuntimeException(
'TYPO3 Backend access denied: The IP address of your client does not match the list of allowed IP addresses.', 1517949792);