From d76a0e053740fd0d4e632678ee01b2ca999d9e3c Mon Sep 17 00:00:00 2001 From: cajus Date: Fri, 9 Jun 2006 07:43:51 +0000 Subject: [PATCH] Moved snapshot routine here git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3740 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_plugin.inc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/class_plugin.inc b/include/class_plugin.inc index 6b7eb8277..d240213dc 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -983,6 +983,25 @@ class plugin return $reason; } + + /* Create a snapshot of the current object */ + function create_snapshot($type= "snapshot", $description= "") + { + $ldap= $this->config->get_ldap_link(); + + if ($ldap->dn_exists($this->$dn)){ + $data= preg_replace('/^dn:.*\n/', '', $ldap->gen_ldif($this->dn)); + $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']= $this->dn; + print_a($target); + } + } + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> -- 2.30.2