Code

Fixed FAI Hooks.
[gosa.git] / gosa-plugins / fai / admin / fai / class_faiHook.inc
index e150dc518081a0cace38b995685f8f9b6f893900..c0aeae24fe43a4b8ff9d1600d6c2c0e2b6fc3fa4 100644 (file)
@@ -465,7 +465,9 @@ class faiHook extends plugin
     $ldap = $this->config->get_ldap_link();
 
     FAI::prepare_to_save_FAI_object($this->dn,$this->attrs);
-    show_ldap_error($ldap->get_error(), sprintf(_("Saving of FAI/hook with dn '%s' failed."),$this->dn));
+    if (!$ldap->success()){
+      msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
+    }
 
     if($this->initially_was_account){
       new log("modify","fai/".get_class($this),$this->dn,$this->attributes);
@@ -484,18 +486,7 @@ class faiHook extends plugin
 
     /* We do not need to save untouched objects */
     foreach($this->SubObjects as $name => $obj){
-      if($obj['status'] == "FreshLoaded"){
-        unset($this->SubObjects[$name]);
-      }
-    }
-
-    foreach($this->SubObjects as $name => $obj){
-      if($obj['status'] == "delete"){
-        $Objects[$name] = $obj; 
-      }
-    }
-    foreach($this->SubObjects as $name => $obj){
-      if($obj['status'] != "delete"){
+      if($obj['status'] != "FreshLoaded"){
         $Objects[$name] = $obj; 
       }
     }