From c155a8330c25b583a12e4c574c5007277f1cf401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannis=20Mo=C3=9Fhammer?= Date: Thu, 20 Jun 2013 13:47:51 +0200 Subject: [PATCH 01/46] Add SystemPermissionException This exception should be fired when the OS restricts the web user from executing certain actions. Also the template for errors has been modified so it displays the action and the target that was prevented. refs #4092 --- application/controllers/ErrorController.php | 3 +-- application/views/scripts/error/error.phtml | 11 ++++++++-- .../Exception/SystemPermissionException.php | 22 +++++++++++++++++++ 3 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 library/Icinga/Exception/SystemPermissionException.php diff --git a/application/controllers/ErrorController.php b/application/controllers/ErrorController.php index efcc20e9b..c523bb77f 100755 --- a/application/controllers/ErrorController.php +++ b/application/controllers/ErrorController.php @@ -34,7 +34,6 @@ class ErrorController extends ActionController $this->view->message = 'Application error'; break; } - // conditionally display exceptions if ($this->getInvokeArg('displayExceptions') == true) { $this->view->exception = $errors->exception; @@ -44,4 +43,4 @@ class ErrorController extends ActionController } } -// @codingStandardsIgnoreEnd \ No newline at end of file +// @codingStandardsIgnoreEnd diff --git a/application/views/scripts/error/error.phtml b/application/views/scripts/error/error.phtml index 9ae6ecd1f..b5cfcddcb 100755 --- a/application/views/scripts/error/error.phtml +++ b/application/views/scripts/error/error.phtml @@ -9,8 +9,15 @@

Exception information:

-

- Message: exception->getMessage() ?> +

+ Message: exception->getMessage() ?> + exception->action)): ?> +
Action: exception->action; ?> + + exception->action)): ?> +
Target: exception->target; ?> + +

Stack trace:

diff --git a/library/Icinga/Exception/SystemPermissionException.php b/library/Icinga/Exception/SystemPermissionException.php new file mode 100644 index 000000000..02849ec34 --- /dev/null +++ b/library/Icinga/Exception/SystemPermissionException.php @@ -0,0 +1,22 @@ +action = $action; + $this->target = $target; + } +} From 076b8a9af934e4a33db2dd42864f8746970cb426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannis=20Mo=C3=9Fhammer?= Date: Thu, 20 Jun 2013 14:02:58 +0200 Subject: [PATCH 02/46] Add rule for 'body' container and QLink property 'target' QLinks can now define the target for their link. Additionally, the targte 'body' is now always the tag. This allows the modulemanager to reload the whole page (with the navigation bar). refs #4092 --- .../layouts/scripts/just-the-body.phtml | 8 --- application/layouts/scripts/layout.phtml | 4 +- .../layouts/scripts/parts/navigation.phtml | 3 +- application/views/helpers/Qlink.php | 5 +- public/js/icinga/modules/mainDetail.js | 71 ++++++++++--------- public/js/icinga/util/async.js | 8 +-- 6 files changed, 49 insertions(+), 50 deletions(-) diff --git a/application/layouts/scripts/just-the-body.phtml b/application/layouts/scripts/just-the-body.phtml index e243e63ed..ee29c44e6 100755 --- a/application/layouts/scripts/just-the-body.phtml +++ b/application/layouts/scripts/just-the-body.phtml @@ -12,14 +12,6 @@
-
- - - - - - -
diff --git a/application/layouts/scripts/layout.phtml b/application/layouts/scripts/layout.phtml index cfe89626c..d70627d1b 100755 --- a/application/layouts/scripts/layout.phtml +++ b/application/layouts/scripts/layout.phtml @@ -21,12 +21,12 @@ ICINGA_DEBUG = true; - + - + render('parts/topbar.phtml') ?>
diff --git a/application/layouts/scripts/parts/navigation.phtml b/application/layouts/scripts/parts/navigation.phtml index 1184d1830..e7de8f369 100755 --- a/application/layouts/scripts/parts/navigation.phtml +++ b/application/layouts/scripts/parts/navigation.phtml @@ -5,7 +5,8 @@ $item = $this->navigation->listAll("menu"); ?> -auth()->isAuthenticated()): ?> +auth()->isAuthenticated()): ?> +