Code

Updated GOsa daemon handler class.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 20 Feb 2008 12:24:13 +0000 (12:24 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 20 Feb 2008 12:24:13 +0000 (12:24 +0000)
-Fixed error handling.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8984 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_gosaSupportDaemon.inc

index 4427592eb54d17e10ad246cbb6da27c54d07b7b0..adb819baec9112fee9670bc1b007050ae992095a 100644 (file)
@@ -92,7 +92,8 @@ class gosaSupportDaemon
       $this->o_sock->setEncryptionKey($this->s_encryption_key); 
       $this->is_connected = TRUE;
     }else{
-      $this->error = $this->o_sock->get_error();
+      $this->s_error = $this->o_sock->get_error();
+      $this->b_error = TRUE;
       $this->disconnect();
     }
     return($this->is_connected);
@@ -139,7 +140,7 @@ class gosaSupportDaemon
   /*! \brief  Returns an array containing all queued entries.
     @return Array All queued entries as an array.
    */
-  public function get_queued_entries($from=0,$to=10,$sort="timestamp DESC")
+  public function get_queued_entries($from=-1,$to=-1,$sort="timestamp DESC")
   {
     $this->b_error = FALSE;
     $this->s_error = "";
@@ -155,11 +156,15 @@ class gosaSupportDaemon
         </phrase>
       </clause>
       </where>
-      <orderby>".$sort."</orderby>
+      <orderby>".$sort."</orderby>";
+if($from != -1 && $to != -1){
+$xml_msg.= "
       <limit>
-      <from>".$from."</from>
-      <to>".$to."</to>
-      </limit>
+       <from>".$from."</from>
+       <to>".$to."</to>
+      </limit>";
+}
+$xml_msg.= "
       </xml>";
 
     if($this->connect()){
@@ -175,7 +180,7 @@ class gosaSupportDaemon
           foreach(array("HEADER","SOURCE","TARGET") as $type){
             unset($entries['XML'][$type]);
           }
-          $ret = $entries; 
+          $ret = $entries['XML']
         }
       }
     }
@@ -595,7 +600,6 @@ class gosaSupportDaemon
     if (tests::is_mac($target)){
     /* Get communication object */
        $d= new gosaSupportDaemon(TRUE,0.5);
-
        $answer= $d->_send("<xml><header>gosa_ping</header><source>GOSA</source><target>$target</target></xml>", TRUE);
        return (count($answer) ? TRUE:FALSE);
     }