From: hickert Date: Tue, 18 Mar 2008 08:21:28 +0000 (+0000) Subject: Updated GOsa Daemon X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ccfe9450aa04bd91ad7d90fe937bce0c93919537;p=gosa.git Updated GOsa Daemon -Added FAI Server/Release request function. -Added FAI Class request function. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9909 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc index a6e1c410f..bbb417f79 100644 --- a/gosa-core/include/class_gosaSupportDaemon.inc +++ b/gosa-core/include/class_gosaSupportDaemon.inc @@ -130,6 +130,73 @@ class gosaSupportDaemon } + public function FAI_get_server($name = "") + { + $this->reset_error(); + + $xml_msg = "
gosa_query_fai_server
GOSAGOSA
"; + $ret = array(); + if($this->connect()){ + $this->o_sock->write($xml_msg); + $str = trim($this->o_sock->read()); + $entries = $this->xml_to_array($str); + if(isset($entries['XML']) && is_array($entries['XML'])){ + + /* Check if returned values represent a valid answer */ + if(isset($entries['XML'])){ + if(isset($entries['XML']['ERROR_STRING'])) { + $this->set_error($entries['XML']['ERROR_STRING']); + new log("debug","DaemonEvent (IDS) ", "gosaSupportDaemon::update_entries()", $ids,"FAILED setting (".$attr.") error was ".$this->get_error()); + return($ret); + } + + /* Unset header tags */ + foreach(array("HEADER","SOURCE","TARGET") as $type){ + unset($entries['XML'][$type]); + } + $ret = $entries['XML']; + } + } + } + return($ret); + } + + + public function FAI_get_classes($name = "") + { + $this->reset_error(); + + $xml_msg = "
gosa_query_fai_release
GOSAsigaGOSA
"; + $xml_msg = "
gosa_query_fai_release
GOSAGOSAsiga
"; + $xml_msg = "
gosa_query_fai_release
GOSAGOSA
"; + $ret = array(); + if($this->connect()){ + $this->o_sock->write($xml_msg); + $str = trim($this->o_sock->read()); + $entries = $this->xml_to_array($str); + print_a($entries); + if(isset($entries['XML']) && is_array($entries['XML'])){ + + /* Check if returned values represent a valid answer */ + if(isset($entries['XML'])){ + if(isset($entries['XML']['ERROR_STRING'])) { + $this->set_error($entries['XML']['ERROR_STRING']); + new log("debug","DaemonEvent (IDS) ", "gosaSupportDaemon::update_entries()", $ids,"FAILED setting (".$attr.") error was ".$this->get_error()); + return($ret); + } + + /* Unset header tags */ + foreach(array("HEADER","SOURCE","TARGET") as $type){ + unset($entries['XML'][$type]); + } + $ret = $entries['XML']; + } + } + } + return($ret); + } + + /*! \brief Returns an array containing all queued entries. @return Array All queued entries as an array. */ @@ -149,7 +216,8 @@ class gosaSupportDaemon $tags = "".$tags.""; } - $xml_msg = " + $xml_msg = +"
gosa_query_jobdb
GOSA GOSA @@ -614,7 +682,7 @@ $xml_msg.= " /* Prepare data */ foreach ($data as $key => $value){ if(is_array($value)){ - foreach($value as $sub_val){ + foreach($value as $sub_value){ $xml_message.= "<$key>$sub_value"; } }else{