Loading ACP3/Core/Application/Bootstrap.php +16 −16 Original line number Original line Diff line number Diff line Loading @@ -5,8 +5,6 @@ namespace ACP3\Core\Application; use ACP3\Core\Controller\AreaEnum; use ACP3\Core\Controller\AreaEnum; use ACP3\Core\DependencyInjection\ServiceContainerBuilder; use ACP3\Core\DependencyInjection\ServiceContainerBuilder; use ACP3\Core\Environment\ApplicationMode; use ACP3\Core\Environment\ApplicationMode; use ACP3\Core\Http\RedirectResponse; use ACP3\Core\Http\RequestInterface; use ACP3\Core\View; use ACP3\Core\View; use ACP3\Modules\ACP3\System\Installer\Schema; use ACP3\Modules\ACP3\System\Installer\Schema; use Patchwork\Utf8; use Patchwork\Utf8; Loading Loading @@ -84,9 +82,6 @@ class Bootstrap extends AbstractBootstrap */ */ public function outputPage() public function outputPage() { { /** @var \ACP3\Core\Http\Request $request */ $request = $this->container->get('core.http.request'); /** @var \ACP3\Core\Http\RedirectResponse $redirect */ /** @var \ACP3\Core\Http\RedirectResponse $redirect */ $redirect = $this->container->get('core.http.redirect_response'); $redirect = $this->container->get('core.http.redirect_response'); Loading @@ -95,7 +90,7 @@ class Bootstrap extends AbstractBootstrap $this->setThemePaths(); $this->setThemePaths(); $this->container->get('core.authentication')->authenticate(); $this->container->get('core.authentication')->authenticate(); if ($this->isMaintenanceModeEnabled($request)) { if ($this->isMaintenanceModeEnabled()) { return $this->handleMaintenanceMode(); return $this->handleMaintenanceMode(); } } Loading @@ -103,16 +98,18 @@ class Bootstrap extends AbstractBootstrap } catch (\ACP3\Core\Controller\Exception\ResultNotExistsException $e) { } catch (\ACP3\Core\Controller\Exception\ResultNotExistsException $e) { $response = $redirect->temporary('errors/index/not_found'); $response = $redirect->temporary('errors/index/not_found'); } catch (\ACP3\Core\Authentication\Exception\UnauthorizedAccessException $e) { } catch (\ACP3\Core\Authentication\Exception\UnauthorizedAccessException $e) { /** @var \ACP3\Core\Http\Request $request */ $request = $this->container->get('core.http.request'); $redirectUri = base64_encode($request->getPathInfo()); $redirectUri = base64_encode($request->getPathInfo()); $response = $redirect->temporary('users/index/login/redirect_' . $redirectUri); $response = $redirect->temporary('users/index/login/redirect_' . $redirectUri); } catch (\ACP3\Core\ACL\Exception\AccessForbiddenException $e) { } catch (\ACP3\Core\ACL\Exception\AccessForbiddenException $e) { $response = $redirect->temporary('errors/index/access_forbidden'); $response = $redirect->temporary('errors/index/access_forbidden'); } catch (\ACP3\Core\Controller\Exception\ControllerActionNotFoundException $e) { } catch (\ACP3\Core\Controller\Exception\ControllerActionNotFoundException $e) { $response = $this->handleException($e, $redirect, 'errors/index/not_found'); $response = $redirect->temporary('errors/index/not_found'); } catch (\Exception $e) { } catch (\Exception $e) { $this->logger->critical($e); $this->logger->critical($e); $response = $this->handleException($e, $redirect, 'errors/index/server_error'); $response = $this->handleException($e, 'errors/index/server_error'); } } return $response; return $response; Loading @@ -138,12 +135,13 @@ class Bootstrap extends AbstractBootstrap /** /** * Checks, whether the maintenance mode is active * Checks, whether the maintenance mode is active * * * @param \ACP3\Core\Http\RequestInterface $request * * @return bool * @return bool */ */ private function isMaintenanceModeEnabled(RequestInterface $request) private function isMaintenanceModeEnabled() { { /** @var \ACP3\Core\Http\Request $request */ $request = $this->container->get('core.http.request'); return (bool)$this->systemSettings['maintenance_mode'] === true && return (bool)$this->systemSettings['maintenance_mode'] === true && $request->getArea() !== AreaEnum::AREA_ADMIN && $request->getArea() !== AreaEnum::AREA_ADMIN && strpos($request->getQuery(), 'users/index/login/') !== 0; strpos($request->getQuery(), 'users/index/login/') !== 0; Loading @@ -163,7 +161,7 @@ class Bootstrap extends AbstractBootstrap 'CONTENT' => $this->systemSettings['maintenance_message'] 'CONTENT' => $this->systemSettings['maintenance_message'] ]); ]); $response = new Response($view->fetchTemplate('system/maintenance.tpl')); $response = new Response($view->fetchTemplate('System/layout.maintenance.tpl')); $response->setStatusCode(Response::HTTP_SERVICE_UNAVAILABLE); $response->setStatusCode(Response::HTTP_SERVICE_UNAVAILABLE); return $response; return $response; Loading @@ -171,16 +169,18 @@ class Bootstrap extends AbstractBootstrap /** /** * @param \Exception $exception * @param \Exception $exception * @param \ACP3\Core\Http\RedirectResponse $redirect * @param string $route * @param string $route * @return Response * @return Response */ */ private function handleException(\Exception $exception, RedirectResponse $redirect, $route) private function handleException(\Exception $exception, $route) { { if ($this->appMode === ApplicationMode::DEVELOPMENT) { if ($this->appMode === ApplicationMode::DEVELOPMENT) { return $this->renderApplicationException($exception); return $this->renderApplicationException($exception); } } /** @var \ACP3\Core\Http\RedirectResponse $redirect */ $redirect = $this->container->get('core.http.redirect_response'); return $redirect->temporary($route); return $redirect->temporary($route); } } Loading @@ -198,10 +198,10 @@ class Bootstrap extends AbstractBootstrap $view->assign([ $view->assign([ 'PAGE_TITLE' => 'ACP3', 'PAGE_TITLE' => 'ACP3', 'ROOT_DIR' => $this->appPath->getWebRoot(), 'ROOT_DIR' => $this->appPath->getWebRoot(), 'EXCEPTION' => $exception 'EXCEPTION' => $exception, ]); ]); $response = new Response($view->fetchTemplate('system/exception.tpl')); $response = new Response($view->fetchTemplate('System/layout.exception.tpl')); $response->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR); $response->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR); return $response; return $response; Loading ACP3/Core/Application/BootstrapInterface.php +1 −1 Original line number Original line Diff line number Diff line Loading @@ -14,7 +14,7 @@ interface BootstrapInterface extends HttpKernelInterface /** /** * Contains the current ACP3 version string * Contains the current ACP3 version string */ */ const VERSION = '4.14.0'; const VERSION = '4.15.0'; /** /** * Performs some startup checks * Performs some startup checks Loading ACP3/Core/Application/ControllerActionDispatcher.php +2 −1 Original line number Original line Diff line number Diff line Loading @@ -132,7 +132,8 @@ class ControllerActionDispatcher private function getCallable(ActionInterface $controller) private function getCallable(ActionInterface $controller) { { $callable = [$controller, 'execute']; $callable = [$controller, 'execute']; if ($this->request->getPost()->has('submit') && method_exists($controller, 'executePost')) { if (($this->request->getPost()->has('submit') || $this->request->getPost()->has('continue')) && method_exists($controller, 'executePost')) { $reflection = new \ReflectionMethod($controller, 'executePost'); $reflection = new \ReflectionMethod($controller, 'executePost'); if ($reflection->isPublic()) { if ($reflection->isPublic()) { Loading ACP3/Core/Modules/Helper/Action.php +2 −2 Original line number Original line Diff line number Diff line Loading @@ -90,7 +90,7 @@ class Action { { $errors = $this->alerts->errorBox($exception->getMessage()); $errors = $this->alerts->errorBox($exception->getMessage()); if ($this->request->isXmlHttpRequest()) { if ($this->request->isXmlHttpRequest()) { return new Response($errors, 400); return new Response($errors, Response::HTTP_BAD_REQUEST); } } return ['error_msg' => $errors]; return ['error_msg' => $errors]; Loading Loading @@ -222,7 +222,7 @@ class Action return $this->redirectMessages->setMessage( return $this->redirectMessages->setMessage( $result, $result, $this->translator->t('system', $phrase . ($result !== false ? '_success' : '_error')), $this->translator->t('system', $phrase . ($result !== false ? '_success' : '_error')), $path $this->request->getPost()->has('continue') ? $this->request->getPathInfo() : $path ); ); } } Loading ACP3/Core/View/Renderer/Smarty/Functions/SiteSubtitle.php 0 → 100644 +44 −0 Original line number Original line Diff line number Diff line <?php /** * Copyright (c) by the ACP3 Developers. * See the LICENCE file at the top-level module directory for licencing details. */ namespace ACP3\Core\View\Renderer\Smarty\Functions; use ACP3\Core\Breadcrumb\Title; class SiteSubtitle extends AbstractFunction { /** * @var \ACP3\Core\Breadcrumb\Title */ protected $title; /** * @param \ACP3\Core\Breadcrumb\Title $title */ public function __construct(Title $title) { $this->title = $title; } /** * @param array $params * @param \Smarty_Internal_Template $smarty * * @return string */ public function process(array $params, \Smarty_Internal_Template $smarty) { return $this->title->getSiteSubtitle(); } /** * @inheritdoc */ public function getExtensionName() { return 'site_subtitle'; } } Loading
ACP3/Core/Application/Bootstrap.php +16 −16 Original line number Original line Diff line number Diff line Loading @@ -5,8 +5,6 @@ namespace ACP3\Core\Application; use ACP3\Core\Controller\AreaEnum; use ACP3\Core\Controller\AreaEnum; use ACP3\Core\DependencyInjection\ServiceContainerBuilder; use ACP3\Core\DependencyInjection\ServiceContainerBuilder; use ACP3\Core\Environment\ApplicationMode; use ACP3\Core\Environment\ApplicationMode; use ACP3\Core\Http\RedirectResponse; use ACP3\Core\Http\RequestInterface; use ACP3\Core\View; use ACP3\Core\View; use ACP3\Modules\ACP3\System\Installer\Schema; use ACP3\Modules\ACP3\System\Installer\Schema; use Patchwork\Utf8; use Patchwork\Utf8; Loading Loading @@ -84,9 +82,6 @@ class Bootstrap extends AbstractBootstrap */ */ public function outputPage() public function outputPage() { { /** @var \ACP3\Core\Http\Request $request */ $request = $this->container->get('core.http.request'); /** @var \ACP3\Core\Http\RedirectResponse $redirect */ /** @var \ACP3\Core\Http\RedirectResponse $redirect */ $redirect = $this->container->get('core.http.redirect_response'); $redirect = $this->container->get('core.http.redirect_response'); Loading @@ -95,7 +90,7 @@ class Bootstrap extends AbstractBootstrap $this->setThemePaths(); $this->setThemePaths(); $this->container->get('core.authentication')->authenticate(); $this->container->get('core.authentication')->authenticate(); if ($this->isMaintenanceModeEnabled($request)) { if ($this->isMaintenanceModeEnabled()) { return $this->handleMaintenanceMode(); return $this->handleMaintenanceMode(); } } Loading @@ -103,16 +98,18 @@ class Bootstrap extends AbstractBootstrap } catch (\ACP3\Core\Controller\Exception\ResultNotExistsException $e) { } catch (\ACP3\Core\Controller\Exception\ResultNotExistsException $e) { $response = $redirect->temporary('errors/index/not_found'); $response = $redirect->temporary('errors/index/not_found'); } catch (\ACP3\Core\Authentication\Exception\UnauthorizedAccessException $e) { } catch (\ACP3\Core\Authentication\Exception\UnauthorizedAccessException $e) { /** @var \ACP3\Core\Http\Request $request */ $request = $this->container->get('core.http.request'); $redirectUri = base64_encode($request->getPathInfo()); $redirectUri = base64_encode($request->getPathInfo()); $response = $redirect->temporary('users/index/login/redirect_' . $redirectUri); $response = $redirect->temporary('users/index/login/redirect_' . $redirectUri); } catch (\ACP3\Core\ACL\Exception\AccessForbiddenException $e) { } catch (\ACP3\Core\ACL\Exception\AccessForbiddenException $e) { $response = $redirect->temporary('errors/index/access_forbidden'); $response = $redirect->temporary('errors/index/access_forbidden'); } catch (\ACP3\Core\Controller\Exception\ControllerActionNotFoundException $e) { } catch (\ACP3\Core\Controller\Exception\ControllerActionNotFoundException $e) { $response = $this->handleException($e, $redirect, 'errors/index/not_found'); $response = $redirect->temporary('errors/index/not_found'); } catch (\Exception $e) { } catch (\Exception $e) { $this->logger->critical($e); $this->logger->critical($e); $response = $this->handleException($e, $redirect, 'errors/index/server_error'); $response = $this->handleException($e, 'errors/index/server_error'); } } return $response; return $response; Loading @@ -138,12 +135,13 @@ class Bootstrap extends AbstractBootstrap /** /** * Checks, whether the maintenance mode is active * Checks, whether the maintenance mode is active * * * @param \ACP3\Core\Http\RequestInterface $request * * @return bool * @return bool */ */ private function isMaintenanceModeEnabled(RequestInterface $request) private function isMaintenanceModeEnabled() { { /** @var \ACP3\Core\Http\Request $request */ $request = $this->container->get('core.http.request'); return (bool)$this->systemSettings['maintenance_mode'] === true && return (bool)$this->systemSettings['maintenance_mode'] === true && $request->getArea() !== AreaEnum::AREA_ADMIN && $request->getArea() !== AreaEnum::AREA_ADMIN && strpos($request->getQuery(), 'users/index/login/') !== 0; strpos($request->getQuery(), 'users/index/login/') !== 0; Loading @@ -163,7 +161,7 @@ class Bootstrap extends AbstractBootstrap 'CONTENT' => $this->systemSettings['maintenance_message'] 'CONTENT' => $this->systemSettings['maintenance_message'] ]); ]); $response = new Response($view->fetchTemplate('system/maintenance.tpl')); $response = new Response($view->fetchTemplate('System/layout.maintenance.tpl')); $response->setStatusCode(Response::HTTP_SERVICE_UNAVAILABLE); $response->setStatusCode(Response::HTTP_SERVICE_UNAVAILABLE); return $response; return $response; Loading @@ -171,16 +169,18 @@ class Bootstrap extends AbstractBootstrap /** /** * @param \Exception $exception * @param \Exception $exception * @param \ACP3\Core\Http\RedirectResponse $redirect * @param string $route * @param string $route * @return Response * @return Response */ */ private function handleException(\Exception $exception, RedirectResponse $redirect, $route) private function handleException(\Exception $exception, $route) { { if ($this->appMode === ApplicationMode::DEVELOPMENT) { if ($this->appMode === ApplicationMode::DEVELOPMENT) { return $this->renderApplicationException($exception); return $this->renderApplicationException($exception); } } /** @var \ACP3\Core\Http\RedirectResponse $redirect */ $redirect = $this->container->get('core.http.redirect_response'); return $redirect->temporary($route); return $redirect->temporary($route); } } Loading @@ -198,10 +198,10 @@ class Bootstrap extends AbstractBootstrap $view->assign([ $view->assign([ 'PAGE_TITLE' => 'ACP3', 'PAGE_TITLE' => 'ACP3', 'ROOT_DIR' => $this->appPath->getWebRoot(), 'ROOT_DIR' => $this->appPath->getWebRoot(), 'EXCEPTION' => $exception 'EXCEPTION' => $exception, ]); ]); $response = new Response($view->fetchTemplate('system/exception.tpl')); $response = new Response($view->fetchTemplate('System/layout.exception.tpl')); $response->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR); $response->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR); return $response; return $response; Loading
ACP3/Core/Application/BootstrapInterface.php +1 −1 Original line number Original line Diff line number Diff line Loading @@ -14,7 +14,7 @@ interface BootstrapInterface extends HttpKernelInterface /** /** * Contains the current ACP3 version string * Contains the current ACP3 version string */ */ const VERSION = '4.14.0'; const VERSION = '4.15.0'; /** /** * Performs some startup checks * Performs some startup checks Loading
ACP3/Core/Application/ControllerActionDispatcher.php +2 −1 Original line number Original line Diff line number Diff line Loading @@ -132,7 +132,8 @@ class ControllerActionDispatcher private function getCallable(ActionInterface $controller) private function getCallable(ActionInterface $controller) { { $callable = [$controller, 'execute']; $callable = [$controller, 'execute']; if ($this->request->getPost()->has('submit') && method_exists($controller, 'executePost')) { if (($this->request->getPost()->has('submit') || $this->request->getPost()->has('continue')) && method_exists($controller, 'executePost')) { $reflection = new \ReflectionMethod($controller, 'executePost'); $reflection = new \ReflectionMethod($controller, 'executePost'); if ($reflection->isPublic()) { if ($reflection->isPublic()) { Loading
ACP3/Core/Modules/Helper/Action.php +2 −2 Original line number Original line Diff line number Diff line Loading @@ -90,7 +90,7 @@ class Action { { $errors = $this->alerts->errorBox($exception->getMessage()); $errors = $this->alerts->errorBox($exception->getMessage()); if ($this->request->isXmlHttpRequest()) { if ($this->request->isXmlHttpRequest()) { return new Response($errors, 400); return new Response($errors, Response::HTTP_BAD_REQUEST); } } return ['error_msg' => $errors]; return ['error_msg' => $errors]; Loading Loading @@ -222,7 +222,7 @@ class Action return $this->redirectMessages->setMessage( return $this->redirectMessages->setMessage( $result, $result, $this->translator->t('system', $phrase . ($result !== false ? '_success' : '_error')), $this->translator->t('system', $phrase . ($result !== false ? '_success' : '_error')), $path $this->request->getPost()->has('continue') ? $this->request->getPathInfo() : $path ); ); } } Loading
ACP3/Core/View/Renderer/Smarty/Functions/SiteSubtitle.php 0 → 100644 +44 −0 Original line number Original line Diff line number Diff line <?php /** * Copyright (c) by the ACP3 Developers. * See the LICENCE file at the top-level module directory for licencing details. */ namespace ACP3\Core\View\Renderer\Smarty\Functions; use ACP3\Core\Breadcrumb\Title; class SiteSubtitle extends AbstractFunction { /** * @var \ACP3\Core\Breadcrumb\Title */ protected $title; /** * @param \ACP3\Core\Breadcrumb\Title $title */ public function __construct(Title $title) { $this->title = $title; } /** * @param array $params * @param \Smarty_Internal_Template $smarty * * @return string */ public function process(array $params, \Smarty_Internal_Template $smarty) { return $this->title->getSiteSubtitle(); } /** * @inheritdoc */ public function getExtensionName() { return 'site_subtitle'; } }