From: hickert Date: Thu, 29 Jul 2010 07:51:51 +0000 (+0000) Subject: Updated creation of ldif entries X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=353a7317471d15499ab5fc0bb0def3532193003d;p=gosa.git Updated creation of ldif entries -Use new method export method which is based on shell execution git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@19198 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_SnapshotHandler.inc b/gosa-core/include/class_SnapshotHandler.inc index d371db5fc..e38a9d1d9 100644 --- a/gosa-core/include/class_SnapshotHandler.inc +++ b/gosa-core/include/class_SnapshotHandler.inc @@ -296,8 +296,9 @@ class SnapshotHandler { $new_base = preg_replace("/".preg_quote($base, '/')."$/","",$base_of_object).$snap_base; /* Create object */ -#$data = preg_replace('/^dn:.*\n/', '', $ldap->gen_ldif($dn,"(!(objectClass=gosaDepartment))")); - $data = $ldap->gen_ldif($dn,"(&(!(objectClass=gosaDepartment))(!(objectClass=FAIclass)))"); + $data = $ldap->generateLdif(LDAP::fix($dn), + "(&(!(objectClass=gosaDepartment))(!(objectClass=FAIclass)))",array(),'base'); + $newName = str_replace(".", "", $sec."-".$usec); $target= array(); $target['objectClass'] = array("top", "gosaSnapshotObject"); diff --git a/gosa-core/include/class_ldapMultiplexer.inc b/gosa-core/include/class_ldapMultiplexer.inc index f201cae29..fbd6d91b4 100644 --- a/gosa-core/include/class_ldapMultiplexer.inc +++ b/gosa-core/include/class_ldapMultiplexer.inc @@ -39,7 +39,7 @@ class ldapMultiplexer { public function __call($methodName, $parameters) { /* Add resource pointer if the mentioned methods are used */ - if (preg_match('/^(search|ls|cat|fetch|clearResult|resetResult|count|getDN|recursive_remove|rmdir_recursive|gen_xls|gen_ldif|create_missing_trees|import_single_entry|import_complete_ldif)$/', $methodName)){ + if (preg_match('/^(search|ls|cat|fetch|clearResult|resetResult|count|getDN|recursive_remove|rmdir_recursive|gen_xls|create_missing_trees|import_single_entry|import_complete_ldif)$/', $methodName)){ array_unshift($parameters, $this->sr); } diff --git a/gosa-core/include/class_plugin.inc b/gosa-core/include/class_plugin.inc index a728b97f0..f089bc527 100644 --- a/gosa-core/include/class_plugin.inc +++ b/gosa-core/include/class_plugin.inc @@ -1457,8 +1457,9 @@ class plugin $new_base = preg_replace("/".preg_quote($base, '/')."$/","",$base_of_object).$snap_base; /* Create object */ -#$data = preg_replace('/^dn:.*\n/', '', $ldap->gen_ldif($this->dn,"(!(objectClass=gosaDepartment))")); - $data = $ldap->gen_ldif($this->dn,"(&(!(objectClass=gosaDepartment))(!(objectClass=FAIclass)))"); + $data = $ldap->generateLdif(LDAP::fix($dn), + "(&(!(objectClass=gosaDepartment))(!(objectClass=FAIclass)))",array(),'base'); + $newName = str_replace(".", "", $sec."-".$usec); $target= array(); $target['objectClass'] = array("top", "gosaSnapshotObject");