From: hickert Date: Mon, 10 Jul 2006 11:29:28 +0000 (+0000) Subject: Only start recursive copy if source dn exists X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=41404e8fd2483b0dd43a867e450fc4ba3de3eebc;p=gosa.git Only start recursive copy if source dn exists git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4071 594d385d-05f5-0310-b6e9-bd551577e9d8 --- 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");