Code

Updated debug function for snapshots
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 9 Jun 2006 07:16:11 +0000 (07:16 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 9 Jun 2006 07:16:11 +0000 (07:16 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3736 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_ldap.inc

index 6a2c445103ccbdf074333d7e5d822963df69683c..b289ffe4dcc68a19b504fc538a6b2bc8125b0e27 100644 (file)
@@ -1130,11 +1130,18 @@ function gen_xls ($dn, $filter= "(objectClass=*)", $attributes= array('*'), $rec
          return $objectclasses;
   }
 
-  function create_snapshot($dn)
+  function create_snapshot($dn, $type= "snapshot", $description= "")
   {
     if ($this->dn_exists($dn) && $dn != ""){
       $data= preg_replace('/^dn:.*\n/', '', $this->gen_ldif($dn));
-      echo base64_encode(gzcompress($data, 6));
+      $target= array();
+      $target['objectClass']= array("top", "gosaObjectSnapshot");
+      $target['gosaSnapshotData']= gzcompress($data, 6);
+      $target['gosaSnapshotType']= $type;
+      list($usec, $sec)= explode(" ", microtime());
+      $target['gosaShapshotTimestamp']= preg_replace("/\./", "", $sec.$usec);
+      $target['gosaShapshotDN']= $dn;
+      print_a($target);
     }
   }