Code

Removed show_ldap_error() calls
[gosa.git] / gosa-plugins / fai / admin / fai / class_faiTemplate.inc
index 9c1dd0c98a1e6a55e54e8d203a3f40c0dc3f1833..9015ba8789f9e1f853ef3ff95c591cd0a0a77501 100644 (file)
@@ -61,7 +61,11 @@ class faiTemplate extends plugin
       $attrs_to_search[] = "FAIstate";
       $ldap->search("(&(objectClass=FAIclass)(objectClass=".$this->subClass."))",$attrs_to_search);
 
+      $data = array();
       while($object = $ldap->fetch()){
+        $data[] = $object;
+      }
+      foreach($data as $object){
 
         /* Skip objects, that are tagged as removed */
         if(isset($object['FAIstate'][0])){
@@ -439,7 +443,9 @@ class faiTemplate 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/template 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);