From a9353faabfcf75454bd81c7d1b02693959a09960 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 1 Sep 2006 06:37:25 +0000 Subject: [PATCH] Initial acls for woarkstation service git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4564 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/class_workstationService.inc | 59 +++++++------ plugins/admin/systems/workstationService.tpl | 86 ++++++++++++++++--- 2 files changed, 107 insertions(+), 38 deletions(-) diff --git a/plugins/admin/systems/class_workstationService.inc b/plugins/admin/systems/class_workstationService.inc index dace6a70d..57f9ede7b 100644 --- a/plugins/admin/systems/class_workstationService.inc +++ b/plugins/admin/systems/class_workstationService.inc @@ -256,6 +256,13 @@ class workservice extends plugin /* Show main page */ $smarty= get_smarty(); + /* Assign ACLs */ + $tmp = $this->plInfo(); + foreach($tmp['plProvidedAcls'] as $name => $translated){ + $smarty->assign($name."ACL",$this->getacl($name)); + } + + /* Arrays */ foreach(array("XMethods", "XDrivers", "XResolutions", "XColordepths", "XKbModels", "XKbVariants", @@ -277,13 +284,11 @@ class workservice extends plugin "gotoXKbVariant", "gotoXMouseType", "gotoXMouseport") as $val){ $smarty->assign($val."_select", $this->$val); - $smarty->assign($val."ACL", chkacl($this->acl, $val)); } /* Variables */ foreach(array("gotoXHsync", "gotoXVsync") as $val){ $smarty->assign($val, $this->$val); - $smarty->assign($val."ACL", chkacl($this->acl, $val)); } $smarty->assign("staticAddress", ""); @@ -298,9 +303,14 @@ class workservice extends plugin /* Phone stuff */ $smarty->assign ("goFonHardware", $this->goFonHardware); - $hl= ""; foreach ($this->hardware_list as $cn => $description){ if ($cn == $this->goFonHardware){ $selected= "selected"; @@ -317,7 +327,6 @@ class workservice extends plugin $hl.= "\n"; $smarty->assign ("hardware_list", $hl); $smarty->assign ("gotoXMonitor", $this->gotoXMonitor); - $smarty->assign("AutoSyncACL",chkacl($this->acl,"AutoSync")); if($this->AutoSync){ $smarty->assign("AutoSyncCHK"," checked "); @@ -364,30 +373,31 @@ class workservice extends plugin /* Check vsync for correct usage */ $val= preg_replace ("/\s/", "", $this->gotoXVsync); - if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val) - && chkacl ($this->acl, "gotoXVsync") == ""){ - - $message[]= _("Please specify a valid VSync range."); - } elseif (chkacl ($this->acl, "gotoXVsync") == ""){ - list($v1,$v2)= preg_split ("/[-+]/", $val); - if ($v2 != ""){ - if ($v1 > $v2){ - $message[]= _("Please specify a valid VSync range."); + + if($this->acl_is_writeable("gotoXVsync")){ + if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val)){ + $message[]= _("Please specify a valid VSync range."); + } else{ + list($v1,$v2)= preg_split ("/[-+]/", $val); + if ($v2 != ""){ + if ($v1 > $v2){ + $message[]= _("Please specify a valid VSync range."); + } } } } /* Check hsync for correct usage */ $val= preg_replace ("/\s/", "", $this->gotoXHsync); - if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val) - && chkacl ($this->acl, "gotoXHsync") == ""){ - - $message[]= _("Please specify a valid HSync range."); - } elseif (chkacl ($this->acl, "gotoXHsync") == ""){ - list($v1,$v2)= preg_split ("/[-+]/", $val); - if ($v2 != ""){ - if ($v1 > $v2){ - $message[]= _("Please specify a valid HSync range."); + if($this->acl_is_writeable("gotoXHsync")){ + if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val)){ + $message[]= _("Please specify a valid HSync range."); + } else{ + list($v1,$v2)= preg_split ("/[-+]/", $val); + if ($v2 != ""){ + if ($v1 > $v2){ + $message[]= _("Please specify a valid HSync range."); + } } } } @@ -452,6 +462,7 @@ class workservice extends plugin "gotoXColordepth" => _("Gfx color depth"), "gotoXHsync" => _("Hsync"), "gotoXVsync" => _("Vsync"), + "AutoSync" => _("Use DDC"), "gotoScannerEnable" => _("Scanner enabled"), "gotoXKbModel" => _("Keyboard model"), "gotoXKbLayout" => _("Keyboard layout"), diff --git a/plugins/admin/systems/workstationService.tpl b/plugins/admin/systems/workstationService.tpl index b91d824fa..dafb63718 100644 --- a/plugins/admin/systems/workstationService.tpl +++ b/plugins/admin/systems/workstationService.tpl @@ -6,25 +6,37 @@ - {html_options options=$XKbModels selected=$gotoXKbModel_select} +{/render} + - {html_options options=$XKbLayouts selected=$gotoXKbLayout_select} +{/render} + - {html_options options=$XKbVariants selected=$gotoXKbVariant_select} +{/render} + @@ -41,17 +53,25 @@ - {html_options options=$MouseTypes selected=$gotoXMouseType_select} +{/render} + - {html_options options=$MousePorts selected=$gotoXMouseport_select} +{/render} + @@ -67,7 +87,11 @@
{t}Telephone{/t}  + +{render acl=$goFonHardwareACL} {$hardware_list} +{/render} +
@@ -85,25 +109,37 @@ - {html_options values=$XDrivers output=$XDrivers selected=$gotoXDriver_select} +{/render} + - {html_options options=$XResolutions selected=$gotoXResolution_select} +{/render} + - {html_options options=$XColordepths selected=$gotoXColordepth_select} +{/render} + @@ -121,18 +157,36 @@ {if $gotoXMonitor==""}{t}unknown{/t}{/if}{$gotoXMonitor} - + + +{render acl=$AutoSyncACL} + +{/render} + + {t}Use DDC for automatic detection{/t} - kHz + + +{render acl=$gotoXHsyncACL} + kHz +{/render} + + - Hz + + +{render acl=$gotoXVsyncACL} + Hz +{/render} + + @@ -145,7 +199,11 @@

{t}Scan device{/t}

- + +{render acl=$gotoScannerEnableACL} + +{/render} + {t}Provide scan services{/t}
-- 2.30.2