[icinga-checkins] icinga.org: icingaweb2-module-director/feature/job-scheduling-11627: Objects: delegate rendering zone for groups, users

git at icinga.org git at icinga.org
Mon May 2 10:43:11 CEST 2016


Module: icingaweb2-module-director
Branch: feature/job-scheduling-11627
Commit: f7bd50838dae9fe691d16de8726322e27e9b3088
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=f7bd50838dae9fe691d16de8726322e27e9b3088

Author: Thomas Gelf <thomas at gelf.net>
Date:   Mon May  2 10:26:41 2016 +0200

Objects: delegate rendering zone for groups, users

---

 library/Director/Objects/IcingaObjectGroup.php |    7 +++++++
 library/Director/Objects/IcingaUser.php        |    7 +++++++
 library/Director/Objects/IcingaUserGroup.php   |    7 +++++++
 3 files changed, 21 insertions(+)

diff --git a/library/Director/Objects/IcingaObjectGroup.php b/library/Director/Objects/IcingaObjectGroup.php
index cb667b5..ff84087 100644
--- a/library/Director/Objects/IcingaObjectGroup.php
+++ b/library/Director/Objects/IcingaObjectGroup.php
@@ -2,6 +2,8 @@
 
 namespace Icinga\Module\Director\Objects;
 
+use Icinga\Module\Director\IcingaConfig\IcingaConfig;
+
 abstract class IcingaObjectGroup extends IcingaObject
 {
     protected $supportsImports = true;
@@ -13,4 +15,9 @@ abstract class IcingaObjectGroup extends IcingaObject
         'disabled'              => 'n',
         'display_name'          => null,
     );
+
+    public function getRenderingZone(IcingaConfig $config = null)
+    {
+        return $this->connection->getDefaultGlobalZoneName();
+    }
 }
diff --git a/library/Director/Objects/IcingaUser.php b/library/Director/Objects/IcingaUser.php
index c50a231..a344093 100644
--- a/library/Director/Objects/IcingaUser.php
+++ b/library/Director/Objects/IcingaUser.php
@@ -2,6 +2,8 @@
 
 namespace Icinga\Module\Director\Objects;
 
+use Icinga\Module\Director\IcingaConfig\IcingaConfig;
+
 class IcingaUser extends IcingaObject
 {
     protected $table = 'icinga_user';
@@ -40,4 +42,9 @@ class IcingaUser extends IcingaObject
         'period' => 'IcingaTimePeriod',
         'zone'   => 'IcingaZone',
     );
+
+    public function getRenderingZone(IcingaConfig $config = null)
+    {
+        return $this->connection->getMasterZoneName();
+    }
 }
diff --git a/library/Director/Objects/IcingaUserGroup.php b/library/Director/Objects/IcingaUserGroup.php
index b538614..b85c312 100644
--- a/library/Director/Objects/IcingaUserGroup.php
+++ b/library/Director/Objects/IcingaUserGroup.php
@@ -2,7 +2,14 @@
 
 namespace Icinga\Module\Director\Objects;
 
+use Icinga\Module\Director\IcingaConfig\IcingaConfig;
+
 class IcingaUserGroup extends IcingaObjectGroup
 {
     protected $table = 'icinga_usergroup';
+
+    public function getRenderingZone(IcingaConfig $config = null)
+    {
+        return $this->connection->getMasterZoneName();
+    }
 }



More information about the icinga-checkins mailing list