Code

Updated environment printer assignment
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 14 Jul 2008 08:33:14 +0000 (08:33 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 14 Jul 2008 08:33:14 +0000 (08:33 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11618 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/personal/environment/class_environment.inc
gosa-plugins/goto/personal/environment/class_selectPrinterDialog.inc

index 511565d75902b63b938af076ef5ba1aca0d92b87..5dd34b65c78352e4df9d2e789cdb2dcf321fafbf 100644 (file)
@@ -1353,19 +1353,16 @@ class environment extends plugin
   function printOutPrinterDevices()
   {
     $a_return = array();
-    
-    if($this->acl_is_readable("gotoPrinter")){
 
-      if(is_array($this->gotoPrinter)){
-        foreach($this->gotoPrinter as $printer){
-          if($printer['mode'] == "admin"){
-            $a_return[$printer['cn'][0]]= $printer['cn'][0]." - "._("Administrator");
-          }else{
-            $a_return[$printer['cn'][0]]= $printer['cn'][0]; 
-          }
-          if ($printer['cn'][0] == $this->gosaDefaultPrinter){
-            $a_return[$printer['cn'][0]].=" - "._("Default printer");
-          }
+    if(is_array($this->gotoPrinter)){
+      foreach($this->gotoPrinter as $printer){
+        if($printer['mode'] == "admin"){
+          $a_return[$printer['cn'][0]]= $printer['cn'][0]." - "._("Administrator");
+        }else{
+          $a_return[$printer['cn'][0]]= $printer['cn'][0]; 
+        }
+        if ($printer['cn'][0] == $this->gosaDefaultPrinter){
+          $a_return[$printer['cn'][0]].=" - "._("Default printer");
         }
       }
     }
index b2a9b22c783ed13d48707612aed3c262ac0422d6..473733c98c506c8b04fbbbc6980de57ddb168b25 100644 (file)
@@ -37,7 +37,7 @@ class selectPrinterDialog extends plugin
     /* Load possible departments */
     $ui= get_userinfo();
     $this->ui = $ui;
-    $tdeps= $ui->get_module_departments("users");
+    $tdeps= $ui->get_module_departments("printer");
     $ids = $this->config->idepartments;
     $first = "";
     $found = FALSE;
@@ -136,15 +136,11 @@ class selectPrinterDialog extends plugin
     }
 
     foreach($res as $printer)  {
-
-      $acl = $this->ui->get_permissions($printer['dn'],"printer/printgeneric","gotoUserPrinter");
-
+      $acl = $this->ui->get_permissions($printer['dn'],"printer/printgeneric","gotoUserPrinter");;
       if(!preg_match("/w/",$acl)){
         continue;
       }
-
       if(isset($this->AlreadyAssigned[$printer['cn'][0]])) continue;
-
       if($detailed ==true){
         $a_return[$printer['cn'][0]] = $printer;
       }else{
@@ -159,9 +155,5 @@ class selectPrinterDialog extends plugin
   }
 }
 
-
-
-
-
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>