Code

Fixed error message if saving of printer membership failed.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 30 Jun 2006 04:32:44 +0000 (04:32 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 30 Jun 2006 04:32:44 +0000 (04:32 +0000)
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

index 5b5881132cfdbfe1133981ca51c15a09280f6eb3..59be3400076a91950515821d18d0080fc69d1d98 100644 (file)
@@ -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)