Code

Added first DAK method
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Jun 2008 06:38:19 +0000 (06:38 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Jun 2008 06:38:19 +0000 (06:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11335 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_gosaSupportDaemon.inc

index 94cf2eea3a095421554d3ff045dec96c674df1f5..797d56f4804d5685e41dd35389950dcd74dce637 100644 (file)
@@ -826,6 +826,16 @@ class gosaSupportDaemon
           }
         }
         if ($xml_elem['type'] == 'complete') {
+
+          /* Save tag attributes too. 
+              e.g. <tag attr="val">
+           */
+          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 = "<xml> 
+                  <header>gosa_get_dak_keyring</header> 
+                  <target>".$server."</target> 
+                  <source>GOSA</source>
+                </xml>";
+        
+    $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: