= nl2br($this->escape($message)) ?>
- --
= $this->escape($stackTrace) ?>-
diff --git a/application/controllers/ErrorController.php b/application/controllers/ErrorController.php index 62198ec0c..ed35c3162 100644 --- a/application/controllers/ErrorController.php +++ b/application/controllers/ErrorController.php @@ -35,6 +35,10 @@ class ErrorController extends ActionController 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: @@ -45,11 +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() && $modules->hasInstalled($path) && ! $modules->hasEnabled($path)) { - $this->view->message .= ' ' . sprintf( - $this->translate('Enabling the "%s" module might help!'), - $path - ); + if ($isAuthenticated) { + if ($modules->hasInstalled($path) && ! $modules->hasEnabled($path)) { + $this->view->message .= ' ' . sprintf( + $this->translate('Enabling the "%s" module might help!'), + $path + ); + } } break; @@ -93,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..c0ffd3394 --- /dev/null +++ b/application/layouts/scripts/error.phtml @@ -0,0 +1,8 @@ +
= sprintf( diff --git a/application/views/scripts/error/error.phtml b/application/views/scripts/error/error.phtml index 5b3480922..67429573c 100644 --- a/application/views/scripts/error/error.phtml +++ b/application/views/scripts/error/error.phtml @@ -1,10 +1,12 @@ +
= nl2br($this->escape($message)) ?>
- -= $this->escape($stackTrace) ?>-
= nl2br($this->escape($message)); ?>
+ += $this->escape($stackTrace) ?>+ +