Code

Removed show_ldap_error() calls
[gosa.git] / gosa-plugins / fai / admin / fai / class_faiTemplate.inc
index 863ee2b3e877252db0be0d0c9543cebdacf9d167..9015ba8789f9e1f853ef3ff95c591cd0a0a77501 100644 (file)
@@ -2,11 +2,6 @@
 
 class faiTemplate extends plugin
 {
-  /* CLI vars */
-  var $cli_summary      = "Manage server basic objects";
-  var $cli_description  = "Some longer text\nfor help";
-  var $cli_parameters   = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
   /* attribute list for save action */
   var $ignore_account   = TRUE;
 
@@ -66,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])){
@@ -224,7 +223,7 @@ class faiTemplate extends plugin
       $msgs = $this->dialog->check();
       if(count($msgs)>0){
         foreach($msgs as $msg){
-          print_red($msg);
+          msg_dialog::display(_("Error"), $msg, ERROR_DIALOG);
         }
       }else{
         /* Get return object */
@@ -444,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);