From c5f3f04cd3710e6ed8badccd6b3fb98450d28aee Mon Sep 17 00:00:00 2001 From: cajus Date: Fri, 12 May 2006 11:38:19 +0000 Subject: [PATCH] Added a few ldap error informations git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3318 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiHook.inc | 8 +++++--- plugins/admin/fai/class_faiPartitionTable.inc | 17 ++++++++--------- plugins/admin/fai/class_faiProfile.inc | 3 ++- .../admin/systems/class_systemManagement.inc | 18 +++++++++--------- 4 files changed, 24 insertions(+), 22 deletions(-) diff --git a/plugins/admin/fai/class_faiHook.inc b/plugins/admin/fai/class_faiHook.inc index dcef17f8f..376a41834 100644 --- a/plugins/admin/fai/class_faiHook.inc +++ b/plugins/admin/fai/class_faiHook.inc @@ -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()); } } } diff --git a/plugins/admin/fai/class_faiPartitionTable.inc b/plugins/admin/fai/class_faiPartitionTable.inc index 336d93180..efc90856b 100644 --- a/plugins/admin/fai/class_faiPartitionTable.inc +++ b/plugins/admin/fai/class_faiPartitionTable.inc @@ -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"); diff --git a/plugins/admin/fai/class_faiProfile.inc b/plugins/admin/fai/class_faiProfile.inc index 489b8bb26..40c61eb32 100644 --- a/plugins/admin/fai/class_faiProfile.inc +++ b/plugins/admin/fai/class_faiProfile.inc @@ -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(); diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index 3bde9f10e..adcb5b6be 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -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); -- 2.30.2