From 5c6b9cf58de917cae870884cadd9e6d2d844bfdd Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 30 Jun 2006 04:32:44 +0000 Subject: [PATCH] Fixed error message if saving of printer membership failed. Fixed printer membership saving. array('count'=>'0') was also saved as member. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4000 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/personal/environment/class_environment.inc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index 5b5881132..59be34000 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -973,6 +973,7 @@ class environment extends plugin /* Remove normal entries (User)*/ if(isset($attr['goto'.$s_suffix.'Printer'])) { + unset($attr['goto'.$s_suffix.'Printer']['count']); foreach($attr['goto'.$s_suffix.'Printer'] as $key => $user){ if($this->uid==$user){ unset($attr['goto'.$s_suffix.'Printer'][$key]); @@ -988,6 +989,7 @@ class environment extends plugin /* Remove administrational entries (Admin)*/ if(isset($attr['goto'.$s_suffix.'AdminPrinter'])){ + unset($attr['goto'.$s_suffix.'AdminPrinter']['count']); foreach($attr['goto'.$s_suffix.'AdminPrinter'] as $key => $user){ if($this->uid==$user){ unset($attr['goto'.$s_suffix.'AdminPrinter'][$key]); @@ -1029,12 +1031,11 @@ class environment extends plugin /* Save changes */ $ldap->cd($attr['dn']); + $dn = $attr['dn']; unset($attr['dn']); -$ldap->modify ($attr); - - if($ldap->get_error()!="Success"){ - print_red(_("Error while writing printer")." : ".$ldap->get_error()); - } + + $ldap->modify ($attr); + show_ldap_error($ldap->get_error(),sprintf(_("Saving printer membership with dn %s failed "),$dn)); } /* All printers are cleaned, (our cn/uid removed) -- 2.30.2