Code

Updated create_missing_trees to create the base, too
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 2 May 2007 08:43:36 +0000 (08:43 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 2 May 2007 08:43:36 +0000 (08:43 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6221 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_ldap.inc

index 8c5698a44833f6e3ffa7507271770bb526b59769..5da63f53488d8b7fadb53364fb27bb5b4e9afbc7 100644 (file)
@@ -644,13 +644,13 @@ class LDAP{
   {
     global $config;
 
-    /* Ignore create_missing trees if the base equals target */
+    $real_path= substr($target, 0, strlen($target) - strlen($this->basedn) -1 );
+
     if ($target == $this->basedn){
-     return;
+      $l= array("dummy");
+    } else {
+      $l= array_reverse(gosa_ldap_explode_dn($real_path));
     }
-
-    $real_path= substr($target, 0, strlen($target) - strlen($this->basedn) -1 );
-    $l= array_reverse(gosa_ldap_explode_dn($real_path));
     unset($l['count']);
     $cdn= $this->basedn;
     $tag= "";
@@ -659,7 +659,9 @@ class LDAP{
     $classes= $this->get_objectclasses();
 
     foreach ($l as $part){
-      $cdn= "$part,$cdn";
+      if ($party != "dummy"){
+        $cdn= "$part,$cdn";
+      }
 
       /* Ignore referrals */
       $found= false;