diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc
index be7c854a5f508ced2380f143849ca0f58a327bc4..a6e1c410f0de0ed3de5f8c19a146e1f98412f291 100644 (file)
}
}
+ /* Remove session ID. No one is interested in this... */
+ unset($ret['SESSION_ID']);
+
return($ret);
}
}
+ /*! \brief Returns an entry containing all requested ids.
+ @param Array The IDs of the entries we want to return.
+ @return Array Of the requested entries.
+ */
+ public function get_entries_by_mac($macs)
+ {
+ if(!is_array($macs)){
+ trigger_error("Requires an array as parameter.");
+ return;
+ }
+ $this->reset_error();
+
+ $ret = array();
+
+ $xml_msg = "<xml>
+ <header>gosa_query_jobdb</header>
+ <target>GOSA</target>
+ <source>GOSA</source>
+ <where>
+ <clause>
+ <connector>or</connector>";
+ foreach($macs as $mac){
+ $xml_msg .= "<phrase>
+ <operator>eq</operator>
+ <macaddress>".$mac."</macaddress>
+ </phrase>";
+ }
+ $xml_msg .= "</clause>
+ </where>
+ </xml>";
+
+ if($this->connect()){
+ $this->o_sock->write($xml_msg);
+ $str = trim($this->o_sock->read());
+ $entries = $this->xml_to_array($str);
+ if(isset($entries['XML'])){
+ foreach($entries['XML'] as $name => $entry){
+ if(preg_match("/^ANSWER[0-9]*$/",$name)){
+ $ret[$name] = $entry;
+ }
+ }
+ }
+ }
+ return($ret);
+ }
+
+
/*! \brief Returns an entry containing all requested ids.
@param Array The IDs of the entries we want to return.
@return Array Of the requested entries.
if(!isset($params['XML'])){
if (!array_key_exists('XML', $params)){
- $this->set_error(_("Could not parse XML."));
+ $this->set_error(_("Cannot not parse XML!"));
}
$params = array("COUNT" => 0);
}
$request_answer = FALSE;
if($event->get_type() == SCHEDULED_EVENT){
$action = $event->get_schedule_action();
- $request_answer = TRUE;
}elseif($event->get_type() == TRIGGERED_EVENT){
$action = $event->get_trigger_action();
}else{
$tmp->add_targets(array($mac));
$tmp->set_type(TRIGGERED_EVENT);
if(!$this->append($tmp)){
- msg_dialog::display(_("Error"), sprintf(_("Cannot send abort event for entry: %s"),$entry['ID']) , ERROR_DIALOG);
+ msg_dialog::display(_("Error"), sprintf(_("Cannot send abort event for entry %s!"),$entry['ID']) , ERROR_DIALOG);
new log("debug","DaemonEvent ", "gosaSupportDaemon::clean_queue_from_mac()", array($mac => $mac),
"FAILED, could not send 'DaemonEvent_faireboot' for entry ID (".$entry['ID'].") - ".$this->get_error());
}else{
* Failed or waiting events, can be removed without any trouble.
*/
if(!$this->remove_entries(array($entry['ID']))){
- msg_dialog::display(_("Error"), sprintf(_("Cannot remove entry: %s"),$entry['ID']) , ERROR_DIALOG);
+ msg_dialog::display(_("Error"), sprintf(_("Cannot remove entry %s!"),$entry['ID']) , ERROR_DIALOG);
}
;break;
}