[icinga-checkins] icinga.org: icingaweb2/master: Dashboard: Fix reading and disabled system dashboards

git at icinga.org git at icinga.org
Wed Nov 19 12:15:43 CET 2014


Module: icingaweb2
Branch: master
Commit: a5411c7a1c447fe7488866fbc12f7a05b79d146b
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=a5411c7a1c447fe7488866fbc12f7a05b79d146b

Author: Marius Hein <marius.hein at netways.de>
Date:   Wed Nov 19 10:33:41 2014 +0100

Dashboard: Fix reading and disabled system dashboards

refs #4537

---

 application/views/scripts/dashboard/settings.phtml |    1 +
 library/Icinga/Web/Widget/Dashboard.php            |    6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/application/views/scripts/dashboard/settings.phtml b/application/views/scripts/dashboard/settings.phtml
index b14c236..83fba65 100644
--- a/application/views/scripts/dashboard/settings.phtml
+++ b/application/views/scripts/dashboard/settings.phtml
@@ -38,6 +38,7 @@
                     </tr>
                 <?php else: ?>
                     <?php foreach ($components as $component): ?>
+                    <?php if ($component->getDisabled() === true) continue; ?>
                         <tr>
                             <td>
                                 <a href="<?= $this->href('dashboard/update-component', array('pane' => $pane->getName(), 'component' => $component->getTitle()));  ?>">
diff --git a/library/Icinga/Web/Widget/Dashboard.php b/library/Icinga/Web/Widget/Dashboard.php
index ccc8cf2..e663ddf 100644
--- a/library/Icinga/Web/Widget/Dashboard.php
+++ b/library/Icinga/Web/Widget/Dashboard.php
@@ -114,7 +114,11 @@ class Dashboard extends AbstractWidget
      */
     private function loadUserDashboards()
     {
-        $config = Config::fromIni($this->getConfigFile());
+        try {
+            $config = Config::fromIni($this->getConfigFile());
+        } catch (NotReadableError $e) {
+            return;
+        }
         if (! count($config)) {
             return false;
         }



More information about the icinga-checkins mailing list