Code

Updated contrib conf
[gosa.git] / gosa-core / include / class_gosaSupportDaemon.inc
index bea358f72903078d111d8c4650f8100d645fd409..a0b121e5046eaa77a6ba6ed0a8431f24445340fa 100644 (file)
@@ -108,8 +108,12 @@ class gosaSupportDaemon
     $hosts = array();
     if(isset($res['XML'])){
       foreach($res['XML'][0] as $name => $data){
-        if(preg_match("/^HOST[0-9]*$/",$name) && $name != "HOST"){
-          $hosts[] = $data[0]['MAC'][0]['VALUE'];
+        if(preg_match("/^ANSWER[0-9]*$/",$name)){
+          if(isset($data[0]['MAC'][0]['VALUE'])){
+            $hosts[] = $data[0]['MAC'][0]['VALUE'];
+          }elseif(isset($data[0]['VALUE'])){
+            $hosts[] = $data[0]['VALUE'];
+          }
         }
       }
     }
@@ -140,7 +144,7 @@ class gosaSupportDaemon
     $line = __LINE__;
     $class = __CLASS__;
     foreach($debug as $info){
-      if(!in_array($info['function'],array("send_data","_send","set_error"))){
+      if(!in_array($info['function'],array("send_data","_send","set_error","connect"))){
         $file = $info['file'];
         $line = $info['line'];
         $class = get_class($this);
@@ -148,7 +152,7 @@ class gosaSupportDaemon
         break;
       }
     }
-    @DEBUG(GOSA_SI, $line, "<b>".$class."::".$function."</b>" , $file, "<font color='red'><i>".htmlentities($str)."</i></font>", $info="");
+    @DEBUG(DEBUG_SI, $line, "<b>".$class."::".$function."</b>" , $file, "<font color='red'><i>".htmlentities($str)."</i></font>", $info="");
 
     /******
       Set error string.
@@ -983,8 +987,13 @@ class gosaSupportDaemon
    */
   public function _send($data, $answer_expected= FALSE)
   {
-    $this->reset_error();
+
     $ret = array();
+    if(!$this->connect()){
+      return($ret);
+    }
+  
+    $this->reset_error();
 
     /******
       Debug handling
@@ -1003,7 +1012,7 @@ class gosaSupportDaemon
         break;
       }
     }
-    @DEBUG(GOSA_SI, $line, "<b>".$class."::".$function."</b>" , $file, "<i>".htmlentities($data)."</i>", $info="");
+    @DEBUG(DEBUG_SI, $line, "<b>".$class."::".$function."</b>" , $file, "<i>".htmlentities($data)."</i>", $info="");
 
 
     /*******