Objects: delegate rendering zone for groups, users

This commit is contained in:
Thomas Gelf 2016-05-02 10:26:41 +02:00
parent 6708df8a61
commit f7bd50838d
3 changed files with 21 additions and 0 deletions

View File

@ -2,6 +2,8 @@
namespace Icinga\Module\Director\Objects; namespace Icinga\Module\Director\Objects;
use Icinga\Module\Director\IcingaConfig\IcingaConfig;
abstract class IcingaObjectGroup extends IcingaObject abstract class IcingaObjectGroup extends IcingaObject
{ {
protected $supportsImports = true; protected $supportsImports = true;
@ -13,4 +15,9 @@ abstract class IcingaObjectGroup extends IcingaObject
'disabled' => 'n', 'disabled' => 'n',
'display_name' => null, 'display_name' => null,
); );
public function getRenderingZone(IcingaConfig $config = null)
{
return $this->connection->getDefaultGlobalZoneName();
}
} }

View File

@ -2,6 +2,8 @@
namespace Icinga\Module\Director\Objects; namespace Icinga\Module\Director\Objects;
use Icinga\Module\Director\IcingaConfig\IcingaConfig;
class IcingaUser extends IcingaObject class IcingaUser extends IcingaObject
{ {
protected $table = 'icinga_user'; protected $table = 'icinga_user';
@ -40,4 +42,9 @@ class IcingaUser extends IcingaObject
'period' => 'IcingaTimePeriod', 'period' => 'IcingaTimePeriod',
'zone' => 'IcingaZone', 'zone' => 'IcingaZone',
); );
public function getRenderingZone(IcingaConfig $config = null)
{
return $this->connection->getMasterZoneName();
}
} }

View File

@ -2,7 +2,14 @@
namespace Icinga\Module\Director\Objects; namespace Icinga\Module\Director\Objects;
use Icinga\Module\Director\IcingaConfig\IcingaConfig;
class IcingaUserGroup extends IcingaObjectGroup class IcingaUserGroup extends IcingaObjectGroup
{ {
protected $table = 'icinga_usergroup'; protected $table = 'icinga_usergroup';
public function getRenderingZone(IcingaConfig $config = null)
{
return $this->connection->getMasterZoneName();
}
} }