Code

Fixed restore function of snapshots :wq
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 18 Jun 2007 13:09:25 +0000 (13:09 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 18 Jun 2007 13:09:25 +0000 (13:09 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6619 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_ldap.inc

index 3f8aa9959cf965a35f965202c3cafa931a2ebf17..6ae00e89623831ee284932bf2f6f8a8f13cb2410 100644 (file)
@@ -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'];