diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc
index b712d7614f4cd04d8dd19ae71f7462c471231802..a657419d6303eee9825965a2763d44630f13bd5a 100644 (file)
$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);
/*! \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 = "";
</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()){
foreach(array("HEADER","SOURCE","TARGET") as $type){
unset($entries['XML'][$type]);
}
- $ret = $entries;
+ $ret = $entries['XML'];
}
}
}
}
- static function send($header, $to, $data= array())
+ static function send($header, $to, $data= array(), $answer_expected = FALSE)
{
$xml_message= "";
$xml_message.= "<$key>$value</$key>";
}
- return $d->_send("<xml><header>$header</header><source>GOSA</source><target>$to</target>".$xml_message."</xml>");
+ return $d->_send("<xml><header>$header</header><source>GOSA</source><target>$to</target>".$xml_message."</xml>",$answer_expected);
}
+ static function ping($target)
+ {
+ 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);
+ }
+
+ return (FALSE);
+ }
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: