diff --git a/application/controllers/ErrorController.php b/application/controllers/ErrorController.php index 670c64339..ed35c3162 100644 --- a/application/controllers/ErrorController.php +++ b/application/controllers/ErrorController.php @@ -29,13 +29,16 @@ class ErrorController extends ActionController */ public function errorAction() { - $this->view->noAuthPageNotFound = false; $error = $this->_getParam('error_handler'); $exception = $error->exception; /** @var \Exception $exception */ Logger::error($exception); Logger::error('Stacktrace: %s', $exception->getTraceAsString()); + if (! ($isAuthenticated = $this->Auth()->isAuthenticated())) { + $this->innerLayout = 'error'; + } + switch ($error->type) { case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE: case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER: @@ -46,16 +49,13 @@ class ErrorController extends ActionController $path = array_shift($path); $this->getResponse()->setHttpResponseCode(404); $this->view->message = $this->translate('Page not found.'); - if ($this->Auth()->isAuthenticated()) { + if ($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; @@ -99,5 +99,6 @@ class ErrorController extends ActionController } $this->view->request = $error->request; + $this->view->hideControls = ! $isAuthenticated; } } diff --git a/application/layouts/scripts/error.phtml b/application/layouts/scripts/error.phtml new file mode 100644 index 000000000..0464b0ea9 --- /dev/null +++ b/application/layouts/scripts/error.phtml @@ -0,0 +1,8 @@ + + diff --git a/application/views/scripts/error/error.phtml b/application/views/scripts/error/error.phtml index c23397a91..430f9fd97 100644 --- a/application/views/scripts/error/error.phtml +++ b/application/views/scripts/error/error.phtml @@ -1,25 +1,12 @@ - -
- - -
- +
- tabs->showOnlyCloseButton() ?> -
-
-

escape($message)) ?>

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

escape($message)) ?>

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