From: hickert Date: Fri, 7 Nov 2008 11:02:28 +0000 (+0000) Subject: Updated opsi handling. Only perform actions, if fai is activated/installed X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0612f64734f42e34271819c466fddcd701aa27c6;p=gosa.git Updated opsi handling. Only perform actions, if fai is activated/installed git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12965 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/opsi/admin/opsi/class_opsi.inc b/gosa-plugins/opsi/admin/opsi/class_opsi.inc index 194297a80..1ddd6959f 100644 --- a/gosa-plugins/opsi/admin/opsi/class_opsi.inc +++ b/gosa-plugins/opsi/admin/opsi/class_opsi.inc @@ -62,22 +62,29 @@ class opsi extends gosaSupportDaemon /* Detect the target opsi host */ - $opsi_hosts = $this->get_hosts_with_module("opsi_com"); - - /* Just use the first result of the opsi hosts - */ - 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)); + $tmp= $this->config->search("faiManagement", "CLASS",array('menu','tabs')); + if(!empty($tmp) && class_available("faiManagement")){ + $opsi_hosts = $this->get_hosts_with_module("opsi_com"); + + /* Just use the first result of the opsi hosts + */ + 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(!empty($this->target)); + $tmp= $this->config->search("faiManagement", "CLASS",array('menu','tabs')); + if(!empty($tmp) && class_available("faiManagement") && !empty($this->target)){ + return(TRUE); + } + return(FALSE); }