Code

Fixed object creation for missing subtrees
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 21 Sep 2005 07:35:14 +0000 (07:35 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 21 Sep 2005 07:35:14 +0000 (07:35 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1404 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiHook.inc
plugins/admin/fai/class_faiPackage.inc
plugins/admin/fai/class_faiPartitionTable.inc
plugins/admin/fai/class_faiProfile.inc
plugins/admin/fai/class_faiScript.inc
plugins/admin/fai/class_faiTemplate.inc

index a589e67ebf545e36c416e466643668fee41de6dc..269c255ad9a50eb198fb621a257ac9e104ea4e44 100644 (file)
@@ -225,7 +225,7 @@ class faiHook extends plugin
       $ldap->modify($this->attrs);
     }else{
       /* Write FAIscript to ldap*/ 
-      $ldap->cd(preg_replace('/^[^,]+,[^,]+,/', '', $this->dn));
+      $ldap->cd($this->config->current['BASE']);
       $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
       $ldap->cd($this->dn);
       $ldap->add($this->attrs);
@@ -276,7 +276,7 @@ class faiHook extends plugin
         $ldap->modify($tmp);
         $this->handle_post_events("modify");
       }elseif($obj['status']=="new"){
-        $ldap->cd(preg_replace('/^[^,]+,[^,]+,/', '', $sub_dn));
+        $ldap->cd($this->config->current['BASE']);
         $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $sub_dn));
         $ldap->cd($sub_dn);
         $ldap->add($tmp); 
index 3e78f44e12f77244d2a439b8828305f8b4794052..d49d7b14bc9758831b964f1c01195ab56a0a993a 100644 (file)
@@ -130,7 +130,7 @@ class faiPackage extends plugin
       $ldap->modify($this->attrs);
     }else{
       /* Write FAIscript to ldap*/
-      $ldap->cd(preg_replace('/^[^,]+,[^,]+,/', '', $this->dn));
+      $ldap->cd($this->config->current['BASE']);
       $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
       $ldap->cd($this->dn);
       $ldap->add($this->attrs);
index 063e0d95b0a4a32d9be8c892a4add46288b1424b..d5feaa4df0e61ba95efc425c845f416320d6a0c0 100644 (file)
@@ -280,7 +280,7 @@ class faiPartitionTable extends plugin
     $ldap = $this->config->get_ldap_link();
 
     if($this->new){
-      $ldap->cd(preg_replace('/^[^,]+,[^,]+,/', '', $this->dn));
+      $ldap->cd($this->config->current['BASE']);
       $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
       $ldap->cd($this->dn);
       $ldap->add($this->attrs);
@@ -321,7 +321,7 @@ class faiPartitionTable extends plugin
         $ldap->cd($disk_dn);
         $ldap->modify($disk_attrs);
       }elseif($disk['status']== "new"){
-        $ldap->cd(preg_replace('/^[^,]+,[^,]+,/', '', $disk_dn));
+        $ldap->cd($this->config->current['BASE']);
         $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $disk_dn));
         $ldap->cd($disk_dn);
         $ldap->add($disk_attrs);
@@ -354,7 +354,7 @@ class faiPartitionTable extends plugin
           $ldap->cd($partition_dn);
           $ldap->rmdir_recursive($partition_dn);
         }elseif($partition['status'] == "new"){
-          $ldap->cd(preg_replace('/^[^,]+,[^,]+,/', '', $partition_dn));
+          $ldap->cd($this->config->current['BASE']);
           $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $partition_dn));
           $ldap->cd($partition_dn);
           $ldap->add($partition_attrs);
index 02d25dc00e61e860a851a9260f2b00d67f73a4d6..0bca5192ed72c2d5f65a123eec207d26227e4d2b 100644 (file)
@@ -254,7 +254,7 @@ class faiProfile extends plugin
       $ldap->modify($this->attrs);
     }else{
       /* Write FAIscript to ldap*/
-      $ldap->cd(preg_replace('/^[^,]+,[^,]+,/', '', $this->dn));
+      $ldap->cd($this->config->current['BASE']);
       $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
       $ldap->cd($this->dn);
       $ldap->add($this->attrs);
index 267cbe37c0ff2bc7380857aea8c72816206ad617..8e4513d7fb97d82c06bc5cb96335cc386d744d6f 100644 (file)
@@ -215,7 +215,7 @@ class faiScript extends plugin
       $ldap->modify($this->attrs);
     }else{
       /* Write FAIscript to ldap*/
-      $ldap->cd(preg_replace('/^[^,]+,[^,]+,/', '', $this->dn));
+      $ldap->cd($this->config->current['BASE']);
       $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
       $ldap->cd($this->dn);
       $ldap->add($this->attrs);
@@ -266,7 +266,7 @@ class faiScript extends plugin
         $ldap->modify($tmp);
         $this->handle_post_events("modify");
       }elseif($obj['status']=="new"){
-        $ldap->cd(preg_replace('/^[^,]+,[^,]+,/', '', $this->dn));
+        $ldap->cd($this->config->current['BASE']);
         $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
         $ldap->cd($sub_dn);
         $ldap->add($tmp); 
index af5d2ccff81592deabcef93368793f59e3f1c7b3..30bd188c5334ed5366824019a2ce022a0843134d 100644 (file)
@@ -215,7 +215,7 @@ class faiTemplate extends plugin
       $ldap->modify($this->attrs);
     }else{
       /* Write FAIscript to ldap*/
-      $ldap->cd(preg_replace('/^[^,]+,[^,]+,/', '', $this->dn));
+      $ldap->cd($this->config->current['BASE']);
       $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
       $ldap->cd($this->dn);
       $ldap->add($this->attrs);
@@ -264,7 +264,7 @@ class faiTemplate extends plugin
         $ldap->modify($tmp);
         $this->handle_post_events("modify");
       }elseif($obj['status']=="new"){
-        $ldap->cd(preg_replace('/^[^,]+,[^,]+,/', '', $sub_dn));
+        $ldap->cd($this->config->current['BASE']);
         $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $sub_dn));
         $ldap->cd($sub_dn);
         $ldap->add($tmp);