From 79249f516dd10c985caf978db6d9398411e58b34 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 11 Sep 2008 13:47:45 +0000 Subject: [PATCH] Updated Opsi -removed hard coded opsi server git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12428 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-plugins/opsi/admin/opsi/class_opsi.inc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/gosa-plugins/opsi/admin/opsi/class_opsi.inc b/gosa-plugins/opsi/admin/opsi/class_opsi.inc index 3c964b8aa..62a636365 100644 --- a/gosa-plugins/opsi/admin/opsi/class_opsi.inc +++ b/gosa-plugins/opsi/admin/opsi/class_opsi.inc @@ -45,6 +45,7 @@ class opsi extends gosaSupportDaemon { private $config = NULL; protected $use_alternative_xml_parse_method = TRUE; + protected $target = ""; /*! \brief Create opsi object. @param @@ -54,13 +55,26 @@ class opsi extends gosaSupportDaemon { $this->config = $config; gosaSupportDaemon::__construct($config); - $this->target = "00:01:6c:9d:b9:fa"; + + /* Detect the target opsi host + */ + $opsi_hosts = $this->get_hosts_with_module("opsi_com"); + + /* Just use the first result of the opsi hosts + */ + $opsi_hosts[] = "asdfdasf"; + if(count($opsi_hosts) == 1 && isset($opsi_hosts[0])){ + $this->target = $opsi_hosts[0]; + }elseif(count($opsi_hosts) > 1){ + $this->target = $opsi_hosts[0]; + msg_dialog::display(_("Opsi"),sprintf(_("More than one Opsi server were found, using the first result '%s'."),$this->target)); + } } public function enabled() { - return(TRUE); + return(tests::is_mac($this->target)); } /****************** -- 2.30.2