Code

Added a few ldap error informations
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 12 May 2006 11:38:19 +0000 (11:38 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 12 May 2006 11:38:19 +0000 (11:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3318 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiHook.inc
plugins/admin/fai/class_faiPartitionTable.inc
plugins/admin/fai/class_faiProfile.inc
plugins/admin/systems/class_systemManagement.inc

index dcef17f8f14db1ff255fbc9867dcb7dd0eff13f6..376a418348a7ce5c0ab8eb0f4e050e24636d0dac 100644 (file)
@@ -329,6 +329,7 @@ class faiHook extends plugin
     $ldap = $this->config->get_ldap_link();
     $ldap->cd ($this->dn);
     $ldap->rmdir_recursive($this->dn);
+    show_ldap_error($ldap->get_error(), _("Removing FAI hook base failed")); 
     $this->handle_post_events("remove");    
   }
 
@@ -379,11 +380,10 @@ class faiHook extends plugin
       $ldap->cd($this->dn);
       $ldap->add($this->attrs);
     }
-    show_ldap_error($ldap->get_error()); 
+    show_ldap_error($ldap->get_error(), _("Saving FAI hook base failed")); 
 
     /* Do object tagging */
     $this->handle_object_tagging();
-    show_ldap_error($ldap->get_error()); 
 
     $ldap->cd($this->dn);
 
@@ -448,11 +448,13 @@ class faiHook extends plugin
         $ldap->cd($sub_dn);
         $ldap->rmdir_recursive($sub_dn);
         $this->handle_post_events("remove");
+        show_ldap_error($ldap->get_error(), _("Removing FAI hook failed")); 
       }elseif($obj['status'] == "edited"){
         $ldap->cd($sub_dn);
         $this->cleanup();
         $ldap->modify ($tmp); 
         $this->handle_post_events("modify");
+        show_ldap_error($ldap->get_error(), _("Saving FAI hook failed")); 
       }elseif($obj['status']=="new"){
         if($tmp['description']==array()){
           unset($tmp['description']);
@@ -462,9 +464,9 @@ class faiHook extends plugin
         $ldap->cd($sub_dn);
         $ldap->add($tmp); 
         $this->handle_post_events("add");
+        show_ldap_error($ldap->get_error(), _("Saving FAI hook failed")); 
       }
       $this->handle_object_tagging($sub_dn, $this->gosaUnitTag);
-      show_ldap_error($ldap->get_error()); 
     }
   }
 }
index 336d93180bb3f397b173c7e54e7a7463df8c1caa..efc90856b669f60b3235cec13dc789bc13935d77 100644 (file)
@@ -338,19 +338,17 @@ class faiPartitionTable extends plugin
       $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
       $ldap->cd($this->dn);
       $ldap->add($this->attrs);
-      show_ldap_error($ldap->get_error());
     }else{
       /* Add partition table to ldap
        */
       $ldap->cd($this->dn);
       $this->cleanup();
       $ldap->modify ($this->attrs); 
-      show_ldap_error($ldap->get_error());
     }
+    show_ldap_error($ldap->get_error(), _("Saving FAI partition table base failed"));
   
     /* Do object tagging */
     $this->handle_object_tagging();
-    show_ldap_error($ldap->get_error());
   
     /* Sort entries, because we must delete entries with status="delete" first */
     $order = array();
@@ -389,6 +387,7 @@ class faiPartitionTable extends plugin
       if($disk['status'] == "delete"){
         $ldap->cd($disk_dn);
         $ldap->rmdir_recursive($disk_dn);
+        show_ldap_error($ldap->get_error(), _("Removing FAI partition table failed"));
       }elseif($disk['status']== "edited"){
         if(empty($disk_attrs['description'])){
           $disk_attrs['description']=array();
@@ -396,6 +395,7 @@ class faiPartitionTable extends plugin
         $ldap->cd($disk_dn);
         $this->cleanup();
         $ldap->modify ($disk_attrs); 
+        show_ldap_error($ldap->get_error(), _("Saving FAI partition table failed"));
       }elseif($disk['status']== "new"){
         if(empty($disk_attrs['description'])){
           unset($disk_attrs['description']);
@@ -404,13 +404,12 @@ class faiPartitionTable extends plugin
         $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $disk_dn));
         $ldap->cd($disk_dn);
         $ldap->add($disk_attrs);
+        show_ldap_error($ldap->get_error(), _("Saving FAI partition table failed"));
       }else{
         print_red("unknown status while saving disks");
       }
 
-      show_ldap_error($ldap->get_error());
       $this->handle_object_tagging($disk_dn, $this->gosaUnitTag);
-      show_ldap_error($ldap->get_error());
 
       if($disk['status']!="delete")
       /* Add all partitions */
@@ -453,6 +452,7 @@ class faiPartitionTable extends plugin
         if(($partition['status'] == "delete")&&($disk['status']!="new")){
           $ldap->cd($partition_dn);
           $ldap->rmdir_recursive($partition_dn);
+          show_ldap_error($ldap->get_error(), _("Removing FAI partition table entry failed"));
         }elseif($partition['status'] == "new"){
           if(empty($partition_attrs['description'])){
             unset($partition_attrs['description']);
@@ -461,19 +461,18 @@ class faiPartitionTable extends plugin
           $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $partition_dn));
           $ldap->cd($partition_dn);
           $ldap->add($partition_attrs);
+          show_ldap_error($ldap->get_error(), _("Saving FAI partition table entry failed"));
         }elseif($partition['status'] == "edited"){
           if(empty($partition_attrs['description'])){
             $partition_attrs['description']=array();
           }
           $ldap->cd($partition_dn);
           $this->cleanup();
-$ldap->modify ($partition_attrs); 
-
+          $ldap->modify ($partition_attrs); 
+          show_ldap_error($ldap->get_error(), _("Saving FAI partition table entry failed"));
         } 
-        show_ldap_error($ldap->get_error());
 
         $this->handle_object_tagging($partition_dn, $this->gosaUnitTag);
-        show_ldap_error($ldap->get_error());
       }
     }
     $this->handle_post_events("add");
index 489b8bb26662c3ff02ea720cf01aa7c951029ba5..40c61eb329fbc33aa2238fc939b48fbd6d67d415 100644 (file)
@@ -356,6 +356,7 @@ class faiProfile extends plugin
     $ldap = $this->config->get_ldap_link();
     $ldap->cd ($this->dn);
     $ldap->rmdir_recursive($this->dn);
+    show_ldap_error($ldap->get_error(), _("Removing FAI profile failed"));
     $this->handle_post_events("remove");    
   }
 
@@ -425,7 +426,7 @@ class faiProfile extends plugin
       $ldap->cd($this->dn);
       $ldap->add($this->attrs);
     }
-    show_ldap_error($ldap->get_error());
+    show_ldap_error($ldap->get_error(), _("Saving FAI profile failed"));
 
     /* Do object tagging */
     $this->handle_object_tagging();
index 3bde9f10e045738fa61f15fd72d631076159241f..adcb5b6bee0da4dbe5c68481797110a4a43b30c0 100644 (file)
@@ -705,22 +705,22 @@ class systems extends plugin
   function get_system_type($classes)
   {
     $type= "";
-    if (in_array('ieee802Device', $classes)){
+    if (in_array_ics('ieee802Device', $classes)){
       $type= "component";
-    }elseif (in_array('gotoTerminal', $classes)){
+    }elseif (in_array_ics('gotoTerminal', $classes)){
       $type= "terminal";
-    }elseif (in_array('gotoWorkstation', $classes)){
+    }elseif (in_array_ics('gotoWorkstation', $classes)){
       $type= "workstation";
-    }elseif (in_array('gotoPrinter', $classes)){
+    }elseif (in_array_ics('gotoPrinter', $classes)){
       $type= "printer";
-    }elseif (in_array('goFonHardware', $classes)){
+    }elseif (in_array_ics('goFonHardware', $classes)){
       $type= "phone";
-    }elseif (in_array('goServer', $classes)){
+    }elseif (in_array_ics('goServer', $classes)){
       $type= "server";
-    }elseif (in_array('GOhard', $classes)){
+    }elseif (in_array_ics('GOhard', $classes)){
       $type= "NewDevice";
-    }elseif (in_array('sambaAccount', $classes) ||
-        in_array('sambaSamAccount', $classes)){
+    }elseif (in_array_ics('sambaAccount', $classes) ||
+        in_array_ics('sambaSamAccount', $classes)){
       $type= "winstation";
     }
     return ($type);