From f0c0d394a0cd7cb4d8023195acaf1a5d88ac8a84 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 16 Jun 2008 06:38:19 +0000 Subject: [PATCH] Added first DAK method git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11335 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_gosaSupportDaemon.inc | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc index 94cf2eea3..797d56f48 100644 --- a/gosa-core/include/class_gosaSupportDaemon.inc +++ b/gosa-core/include/class_gosaSupportDaemon.inc @@ -826,6 +826,16 @@ class gosaSupportDaemon } } if ($xml_elem['type'] == 'complete') { + + /* Save tag attributes too. + e.g. + */ + if(isset($xml_elem['attributes'])){ + foreach($xml_elem['attributes'] as $name => $value){ + $test2['ATTRIBUTES'][$name] = $value; + } + } + $start_level = 1; $test2 = &$params; while($start_level < $xml_elem['level']) { @@ -1816,6 +1826,52 @@ class gosaSupportDaemon } return(""); } + + + + + + /***************** + * DAK - Functions + *****************/ + + /*! \brief Returns all currenlty queued entries for a given DAK repository + @param ... + @return Array All queued entries. + */ + public function DAK_get_queue_entries($server) + { + /* Ensure that we send the event to a valid mac address + */ + if(!is_string($server) || !tests::is_mac($server)){ + trigger_error("No valid mac address given '".$server."'."); + return; + } + + /* Create query + */ + $xml_msg = " +
gosa_get_dak_keyring
+ ".$server." + GOSA +
"; + + $res = $this->_send($xml_msg,TRUE); + + /* Check if there are results for POLICY + */ + if(isset($res['XML'])){ + $ret = array(); + foreach($res['XML'] as $key => $entry){ + if(preg_match("/^ANSWER/",$key)){ + $ret[] = $entry; + } + } + return($ret); + }else{ + return(array()); + } + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: -- 2.30.2