Code

Added kernel fetch method
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 15 Apr 2008 10:12:27 +0000 (10:12 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 15 Apr 2008 10:12:27 +0000 (10:12 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10455 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_gosaSupportDaemon.inc

index 5f160733477b1c4b4aae02c7ae594f82a9535981..dbdd47a7591a33f362159a4f9b2953edf38fbee7 100644 (file)
@@ -134,6 +134,45 @@ class gosaSupportDaemon
   }
 
 
+  public function FAI_get_kernels($release)
+  {
+    $xml_msg = "<xml><header>gosa_get_available_kernel</header><source>GOSA</source><target>GOSA</target><release>halut</release></xml>";
+
+    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)