From: hickert Date: Tue, 11 Mar 2008 10:55:29 +0000 (+0000) Subject: Updated daemon X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9b2bbd91d30d8f670b0eae0047f962d823c4d84f;p=gosa.git Updated daemon git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9669 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc index be7c854a5..4511c35e0 100644 --- a/gosa-core/include/class_gosaSupportDaemon.inc +++ b/gosa-core/include/class_gosaSupportDaemon.inc @@ -235,6 +235,53 @@ $xml_msg.= " } + /*! \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 = " +
gosa_query_jobdb
+ GOSA + GOSA + + + or"; + foreach($macs as $mac){ + $xml_msg .= " + eq + ".$mac." + "; + } + $xml_msg .= " + +
"; + + 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.