From f95018b560911f7f6368e215862a754d47f68796 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 14 Jul 2008 08:33:14 +0000 Subject: [PATCH] Updated environment printer assignment git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11618 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../environment/class_environment.inc | 21 ++++++++----------- .../environment/class_selectPrinterDialog.inc | 12 ++--------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/gosa-plugins/goto/personal/environment/class_environment.inc b/gosa-plugins/goto/personal/environment/class_environment.inc index 511565d75..5dd34b65c 100644 --- a/gosa-plugins/goto/personal/environment/class_environment.inc +++ b/gosa-plugins/goto/personal/environment/class_environment.inc @@ -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"); } } } diff --git a/gosa-plugins/goto/personal/environment/class_selectPrinterDialog.inc b/gosa-plugins/goto/personal/environment/class_selectPrinterDialog.inc index b2a9b22c7..473733c98 100644 --- a/gosa-plugins/goto/personal/environment/class_selectPrinterDialog.inc +++ b/gosa-plugins/goto/personal/environment/class_selectPrinterDialog.inc @@ -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: ?> -- 2.30.2