From e0330b4132b45fbbf8ba0cecf0e2e7964dab6ab2 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 18 Jun 2007 13:09:25 +0000 Subject: [PATCH] Fixed restore function of snapshots :wq git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6619 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_ldap.inc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/class_ldap.inc b/include/class_ldap.inc index 3f8aa9959..6ae00e896 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -1112,6 +1112,13 @@ class LDAP{ */ function import_single_entry($str_attr,$modify,$delete) { + global $config; + + if(!$config){ + trigger_error("Can't import ldif, can't read config object."); + } + + if($this->reconnect) $this->connect(); $ret = false; @@ -1189,7 +1196,8 @@ class LDAP{ /* Create missing trees */ $this->cd ($this->basedn); - $this->create_missing_trees($data['dn']); + $this->cd($config->current['BASE']); + $this->create_missing_trees(preg_replace("/^[^,]+,/","",$data['dn'])); $this->cd($data['dn']); $dn = $data['dn']; -- 2.30.2