Code

Replaced hard coded halut with variable ;)
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 17 Apr 2008 06:06:40 +0000 (06:06 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 17 Apr 2008 06:06:40 +0000 (06:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10522 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_gosaSupportDaemon.inc

index 0d86efe43e9a3160f782c166089f5fc541571281..a993a3ad3046dba24de7dfdfd26cae8c8bd64bcc 100644 (file)
@@ -136,7 +136,7 @@ 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>";
+    $xml_msg = "<xml><header>gosa_get_available_kernel</header><source>GOSA</source><target>GOSA</target><release>".$release."</release></xml>";
 
     if($this->connect()){
       $this->o_sock->write($xml_msg);
@@ -430,6 +430,8 @@ $xml_msg.= "
 $xml_msg.= "
       </xml>";
 
+    echo htmlentities($xml_msg);
+
     if($this->connect()){
       $this->o_sock->write($xml_msg);
       $str = trim($this->o_sock->read());
@@ -911,9 +913,29 @@ $xml_msg.= "
   /*! \brief  Returns the number of currently queued objects.
       @return Integer  
    */
-  public function number_of_queued_entries()
+  public function number_of_queued_entries($event_types)
   {
-    $xml_msg ="<xml><header>gosa_count_jobdb</header><target>GOSA</target><source>GOSA</source></xml>";
+    $tags = "";
+    foreach($event_types as $type){
+      $tags .= "<phrase><headertag>".$type."</headertag></phrase>";
+    }
+    if(count($event_types) > 1){
+      $tags = "<connector>or</connector>".$tags;
+    }
+    if(count($event_types)){
+      $tags = "<where><clause>".$tags."</clause></where>";
+    }
+
+
+    $xml_msg =
+      "<xml>".
+      "<header>gosa_query_jobdb</header>".
+      "<target>GOSA</target>".
+      "<source>GOSA</source>".
+      "<select> count ID</select>".
+      $tags.
+      "</xml>";
+
     $this->connect();
     if($this->connect()){
       $this->o_sock->write($xml_msg);
@@ -926,6 +948,7 @@ $xml_msg.= "
       }
 
       $entries = $this->xml_to_array($str);
+      print_a($entries);
       if(isset($entries['XML'])){
         return($entries['XML']['COUNT']);
       }