From d80f358924f6ec57e9464ff26f6380a4e9408caa Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 2 Sep 2005 13:55:37 +0000 Subject: [PATCH] Added information message, if printer belongs to terminal or Workstation git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1309 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_printGeneric.inc | 27 ++++++++++++++++++-- plugins/admin/systems/printer.tpl | 9 +++++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index 28c81aac4..a25df8639 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -30,7 +30,9 @@ class printgeneric extends plugin var $AdminMember =""; var $AdminMembers =array(); var $AdminMemberKeys =array(); - + + var $is_terminalBased = false; + var $member =array(); var $strings = ""; var $type = ""; @@ -121,6 +123,18 @@ class printgeneric extends plugin } } } + + $ldap->search("(&(cn=".$this->cn.")(|(objectClass=gotoTerminal)(objectClass=gotoWorkstation)))",array("cn","objectClass")); + if($attrs = $ldap->fetch()){ + if(in_array("gotoTerminal",$attrs['objectClass'])){ + $this->is_terminalBased = "Terminal"; + }else{ + $this->is_terminalBased = "Workstation"; + } + } + + + } function execute() @@ -307,7 +321,16 @@ class printgeneric extends plugin asort($userlist); asort($adminlist); - + if($this->is_terminalBased){ + if($this->is_terminalBased == "Terminal"){ + $smarty->assign("desc" ,sprintf(_("This printer belongs to terminal %s. You can't rename this printer."),$this->cn)); + }else{ + $smarty->assign("desc" ,sprintf(_("This printer belongs to workstation %s. You can't rename this printer."),$this->cn)); + } + $smarty->assign("cnACL" ," disabled "); + }else{ + $smarty->assign("desc" ,_("")); + } $smarty->assign("UserMember" ,$this->UserMember); $smarty->assign("UserMembers" ,$userlist); $smarty->assign("UserMemberKeys",array_flip($userlist)); diff --git a/plugins/admin/systems/printer.tpl b/plugins/admin/systems/printer.tpl index c04020c5f..9b58d29a3 100644 --- a/plugins/admin/systems/printer.tpl +++ b/plugins/admin/systems/printer.tpl @@ -5,9 +5,14 @@ {if $is_terminal ne 'true'}

{t}General{/t}

+ + + - + @@ -15,7 +20,7 @@
+ {$desc} +
{$must}
- + -- 2.30.2