From cd319f8c7d9e43017f8f48a31f21c8928ffdf852 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 22 Sep 2015 18:21:25 +0200 Subject: [PATCH] Let the error page look like the login page when a non-authenticated user requests a non-existent page refs #10009 --- application/controllers/ErrorController.php | 16 +++++++--- application/views/scripts/error/error.phtml | 35 +++++++++++++++------ 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/application/controllers/ErrorController.php b/application/controllers/ErrorController.php index 62198ec0c..670c64339 100644 --- a/application/controllers/ErrorController.php +++ b/application/controllers/ErrorController.php @@ -29,6 +29,7 @@ class ErrorController extends ActionController */ public function errorAction() { + $this->view->noAuthPageNotFound = false; $error = $this->_getParam('error_handler'); $exception = $error->exception; /** @var \Exception $exception */ @@ -45,11 +46,16 @@ class ErrorController extends ActionController $path = array_shift($path); $this->getResponse()->setHttpResponseCode(404); $this->view->message = $this->translate('Page not found.'); - if ($this->Auth()->isAuthenticated() && $modules->hasInstalled($path) && ! $modules->hasEnabled($path)) { - $this->view->message .= ' ' . sprintf( - $this->translate('Enabling the "%s" module might help!'), - $path - ); + if ($this->Auth()->isAuthenticated()) { + if ($modules->hasInstalled($path) && ! $modules->hasEnabled($path)) { + $this->view->message .= ' ' . sprintf( + $this->translate('Enabling the "%s" module might help!'), + $path + ); + } + } else { + $this->innerLayout = 'inline'; + $this->view->noAuthPageNotFound = true; } break; diff --git a/application/views/scripts/error/error.phtml b/application/views/scripts/error/error.phtml index 5b3480922..b7927983f 100644 --- a/application/views/scripts/error/error.phtml +++ b/application/views/scripts/error/error.phtml @@ -1,10 +1,25 @@ -
-tabs->showOnlyCloseButton() ?> -
-
-

escape($message)) ?>

- -
-
escape($stackTrace) ?>
- -
+ +
+ +
+
+

escape($message)) ?>

+
+
+
+ +
+ tabs->showOnlyCloseButton() ?> +
+
+

escape($message)) ?>

+ +
+
escape($stackTrace) ?>
+ +
+