From cd319f8c7d9e43017f8f48a31f21c8928ffdf852 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 22 Sep 2015 18:21:25 +0200 Subject: [PATCH 1/6] 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) ?>
+ +
+ From ed935696ac864e5e97698ad8e9b9fa36bdaea0c1 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 22 Sep 2015 18:21:25 +0200 Subject: [PATCH 2/6] CSS: outsource .logo related rules into a new .less file `logo.less' refs #10009 --- library/Icinga/Web/StyleSheet.php | 1 + public/css/icinga/layout-structure.less | 3 --- public/css/icinga/login.less | 26 ------------------- public/css/icinga/logo.less | 33 +++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 29 deletions(-) create mode 100644 public/css/icinga/logo.less diff --git a/library/Icinga/Web/StyleSheet.php b/library/Icinga/Web/StyleSheet.php index f22e66d33..dd45743fd 100644 --- a/library/Icinga/Web/StyleSheet.php +++ b/library/Icinga/Web/StyleSheet.php @@ -28,6 +28,7 @@ class StyleSheet 'css/icinga/pagination.less', 'css/icinga/selection-toolbar.less', 'css/icinga/login.less', + 'css/icinga/logo.less', 'css/icinga/controls.less' ); diff --git a/public/css/icinga/layout-structure.less b/public/css/icinga/layout-structure.less index 47adbca7c..fcb5ff390 100644 --- a/public/css/icinga/layout-structure.less +++ b/public/css/icinga/layout-structure.less @@ -280,9 +280,6 @@ html { } #login { - .logo .image img { - width: 70%; - } .form { width: 100%; margin: auto; diff --git a/public/css/icinga/login.less b/public/css/icinga/login.less index a24265e88..1ffdebd40 100644 --- a/public/css/icinga/login.less +++ b/public/css/icinga/login.less @@ -4,37 +4,11 @@ width: 100%; height: 100%; - .logo { - background-color: @colorPetrol; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 60%; - border-bottom: 1px solid #d9d9d9d; - text-align: center; - -webkit-box-shadow: 0 3px 7px -3px #000; - -moz-box-shadow: 0 3px 7px -3px #000; - box-shadow: 0 3px 7px -3px #000; - } - - .image { - position: absolute; - bottom: 1em; - left: 0px; - right: 0px; - text-align: center; - } - .error { margin-left:auto; margin-right:auto; } - .image img { - width: 375px; - } - .form { position: absolute; font-size: 0.9em; diff --git a/public/css/icinga/logo.less b/public/css/icinga/logo.less new file mode 100644 index 000000000..25860b112 --- /dev/null +++ b/public/css/icinga/logo.less @@ -0,0 +1,33 @@ +/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ + +.logo { + background-color: @colorPetrol; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 60%; + border-bottom: 1px solid #d9d9d9d; + text-align: center; + -webkit-box-shadow: 0 3px 7px -3px #000; + -moz-box-shadow: 0 3px 7px -3px #000; + box-shadow: 0 3px 7px -3px #000; + + .image { + position: absolute; + bottom: 1em; + left: 0px; + right: 0px; + text-align: center; + + img { + width: 375px; + } + } +} + +#layout.minimal-layout { + .logo .image img { + width: 70%; + } +} From 426f64e32a7b3989ecf1e23edf8135a730de52e0 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 22 Sep 2015 18:21:25 +0200 Subject: [PATCH 3/6] CSS: rename .form to .below-logo refs #10009 --- .../views/scripts/authentication/login.phtml | 2 +- application/views/scripts/error/error.phtml | 2 +- public/css/icinga/layout-structure.less | 6 +----- public/css/icinga/login.less | 15 +++------------ public/css/icinga/logo.less | 14 ++++++++++++++ 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/application/views/scripts/authentication/login.phtml b/application/views/scripts/authentication/login.phtml index 34a631778..7ae88584b 100644 --- a/application/views/scripts/authentication/login.phtml +++ b/application/views/scripts/authentication/login.phtml @@ -4,7 +4,7 @@ -
+
-
+