From ab52df30cce48507f57f19b2c7f28ccb4157ba60 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 15 Apr 2008 10:12:27 +0000 Subject: [PATCH] Added kernel fetch method git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10455 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_gosaSupportDaemon.inc | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc index 5f1607334..dbdd47a75 100644 --- a/gosa-core/include/class_gosaSupportDaemon.inc +++ b/gosa-core/include/class_gosaSupportDaemon.inc @@ -134,6 +134,45 @@ class gosaSupportDaemon } + public function FAI_get_kernels($release) + { + $xml_msg = "
gosa_get_available_kernel
GOSAGOSAhalut
"; + + if($this->connect()){ + $this->o_sock->write($xml_msg); + $str = trim($this->o_sock->read()); + + /* Check if something went wrong while reading */ + if($this->o_sock->is_error()){ + $this->set_error($this->o_sock->get_error()); + return($ret); + } + + $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","GOsa-si", + get_class($this)."::".__FUNCTION__, array(), + "FAILED error was ".$this->get_error()); + return($ret); + } + + /* Unset header tags */ + foreach(array("HEADER","SOURCE","TARGET","SESSION_ID") as $type){ + if(isset($entries['XML'][$type])){ + unset($entries['XML'][$type]); + } + } + $ret = $entries['XML']; + } + } + } + return($ret); + } public function FAI_get_package_sections($release) -- 2.30.2