From ff457979c436e8d83a557455a94f6a8b8bfd7e95 Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 21 Sep 2005 07:35:14 +0000 Subject: [PATCH] Fixed object creation for missing subtrees git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1404 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiHook.inc | 4 ++-- plugins/admin/fai/class_faiPackage.inc | 2 +- plugins/admin/fai/class_faiPartitionTable.inc | 6 +++--- plugins/admin/fai/class_faiProfile.inc | 2 +- plugins/admin/fai/class_faiScript.inc | 4 ++-- plugins/admin/fai/class_faiTemplate.inc | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/plugins/admin/fai/class_faiHook.inc b/plugins/admin/fai/class_faiHook.inc index a589e67eb..269c255ad 100644 --- a/plugins/admin/fai/class_faiHook.inc +++ b/plugins/admin/fai/class_faiHook.inc @@ -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); diff --git a/plugins/admin/fai/class_faiPackage.inc b/plugins/admin/fai/class_faiPackage.inc index 3e78f44e1..d49d7b14b 100644 --- a/plugins/admin/fai/class_faiPackage.inc +++ b/plugins/admin/fai/class_faiPackage.inc @@ -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); diff --git a/plugins/admin/fai/class_faiPartitionTable.inc b/plugins/admin/fai/class_faiPartitionTable.inc index 063e0d95b..d5feaa4df 100644 --- a/plugins/admin/fai/class_faiPartitionTable.inc +++ b/plugins/admin/fai/class_faiPartitionTable.inc @@ -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); diff --git a/plugins/admin/fai/class_faiProfile.inc b/plugins/admin/fai/class_faiProfile.inc index 02d25dc00..0bca5192e 100644 --- a/plugins/admin/fai/class_faiProfile.inc +++ b/plugins/admin/fai/class_faiProfile.inc @@ -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); diff --git a/plugins/admin/fai/class_faiScript.inc b/plugins/admin/fai/class_faiScript.inc index 267cbe37c..8e4513d7f 100644 --- a/plugins/admin/fai/class_faiScript.inc +++ b/plugins/admin/fai/class_faiScript.inc @@ -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); diff --git a/plugins/admin/fai/class_faiTemplate.inc b/plugins/admin/fai/class_faiTemplate.inc index af5d2ccff..30bd188c5 100644 --- a/plugins/admin/fai/class_faiTemplate.inc +++ b/plugins/admin/fai/class_faiTemplate.inc @@ -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); -- 2.30.2