Code

Fixed renaming of profiles
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 11 Apr 2008 09:24:24 +0000 (09:24 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 11 Apr 2008 09:24:24 +0000 (09:24 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10351 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiProfile.inc

index 212ea1dde18fa07d0c745a69efe648c10a26e30c..c5daa10a7a6566b347e0e5b1673425e2e72ab7cd 100644 (file)
@@ -430,6 +430,13 @@ class faiProfile extends plugin
 
     $this->attrs['FAIclass']=trim($this->FAIclass);
 
+    /* Remove the old FAI profile, if the dn has changed.
+     */
+    if($this->cn != $this->old_cn){
+
+      $old_dn = preg_replace("/^cn=[^,]+,/","cn=".$this->old_cn.",",$this->dn);
+      FAI::prepare_to_save_FAI_object($old_dn,array(),TRUE);
+    }
     FAI::prepare_to_save_FAI_object($this->dn,$this->attrs);
    
     if($this->initially_was_account){