From 0da806cbf73d2ec7999df8d495de2daecb96dd12 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 17 Dec 2015 14:39:28 +0100 Subject: [PATCH] IcingaEndpointForm: allow to choose API users --- application/forms/IcingaEndpointForm.php | 5 +++++ library/Director/Db.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/application/forms/IcingaEndpointForm.php b/application/forms/IcingaEndpointForm.php index 11b40839..7a346a65 100644 --- a/application/forms/IcingaEndpointForm.php +++ b/application/forms/IcingaEndpointForm.php @@ -49,6 +49,11 @@ class IcingaEndpointForm extends DirectorObjectForm 'description' => $this->translate('The log duration time.') )); + $this->addElement('select', 'apiuser_id', array( + 'label' => $this->translate('API user'), + 'multiOptions' => $this->optionalEnum($this->db->enumApiUsers()) + )); + $this->addZoneElement() ->addImportsElement(); diff --git a/library/Director/Db.php b/library/Director/Db.php index 49c897d9..b1d7b718 100644 --- a/library/Director/Db.php +++ b/library/Director/Db.php @@ -390,6 +390,11 @@ class Db extends DbConnection return $this->enumIcingaObjects('usergroup'); } + public function enumApiUsers() + { + return $this->enumIcingaObjects('apiuser'); + } + public function enumSyncRule() { return $this->enum('sync_rule', array('id', 'rule_name'));