From 41404e8fd2483b0dd43a867e450fc4ba3de3eebc Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 10 Jul 2006 11:29:28 +0000 Subject: [PATCH] Only start recursive copy if source dn exists git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4071 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiManagement.inc | 25 ++++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/plugins/admin/fai/class_faiManagement.inc b/plugins/admin/fai/class_faiManagement.inc index 7e4f4e50c..26542a1ae 100644 --- a/plugins/admin/fai/class_faiManagement.inc +++ b/plugins/admin/fai/class_faiManagement.inc @@ -388,18 +388,23 @@ class faiManagement extends plugin /* Duplicate applications */ - $ldap->cd ($appdst); - $ldap->recursive_remove(); - $ldap->cd ($this->config->current['BASE']); - $ldap->copy_FAI_resource_recursive($appsrc,$appdst,$NewReleaseName,$type,true); - + $ldap->cat($appsrc,array("dn")) ; + if($ldap->count()){ + $ldap->cd ($appdst); + $ldap->recursive_remove(); + $ldap->cd ($this->config->current['BASE']); + $ldap->copy_FAI_resource_recursive($appsrc,$appdst,$NewReleaseName,$type,true); + } + /* Duplicate mime types */ - $ldap->cd ($appdst); - $ldap->recursive_remove(); - $ldap->cd ($this->config->current['BASE']); - $ldap->copy_FAI_resource_recursive($mimesrc,$mimedst,$NewReleaseName,$type,true); - + $ldap->cat($mimesrc,array("dn")) ; + if($ldap->count()){ + $ldap->cd ($appdst); + $ldap->recursive_remove(); + $ldap->cd ($this->config->current['BASE']); + $ldap->copy_FAI_resource_recursive($mimesrc,$mimedst,$NewReleaseName,$type,true); + } $attr = array(); $attr['objectClass'] = array("organizationalUnit","FAIbranch"); -- 2.30.2