X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fsystems%2Fclass_workstationService.inc;h=54af9393d7f4567a411d4a39d24d587c35b5c3a4;hb=83bf4784d9c121ae787dd9b266a24ae2f56c7b83;hp=dabcaa0337d1c85eced46f6609dbe79aefa1ae6d;hpb=becd7f72266ac7df952cc81b3da80dda37be8d19;p=gosa.git diff --git a/plugins/admin/systems/class_workstationService.inc b/plugins/admin/systems/class_workstationService.inc index dabcaa033..54af9393d 100644 --- a/plugins/admin/systems/class_workstationService.inc +++ b/plugins/admin/systems/class_workstationService.inc @@ -2,11 +2,6 @@ class workservice extends plugin { - /* CLI vars */ - var $cli_summary= "Manage terminal service aspects"; - var $cli_description= "Some longer text\nfor help"; - var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); - var $gotoScannerEnable; /* Generic terminal attributes */ var $gotoXMonitor= ""; @@ -58,9 +53,9 @@ class workservice extends plugin var $XKbLayouts =array(); var $XKbVariants =array(); - function workservice ($config, $dn= NULL) + function workservice ($config, $dn= NULL, $parent= NULL) { - plugin::plugin ($config, $dn); + plugin::plugin ($config, $dn, $parent); $this->XResolutions= array( "640x480" => "640x480", @@ -112,9 +107,9 @@ class workservice extends plugin "/dev/ttyS1" => "/dev/ttyS1", "/dev/psaux" =>"/dev/psaux", "/dev/input/mice" => "/dev/input/mice"); - /* Additional values will be extracted from /etc/gosa/keyboardLayouts */ + /* Additional values will be extracted from CONFIG_DIR/gosa/keyboardLayouts */ $this->XKbLayouts= array ("de"=> "de","intl" =>"intl","us" =>"us"); - $this->XKbVariants= array ("nodeadkeys"=>"nodeadkeys", "basic"=>"basic"); + $this->XKbVariants= array ("basic"=>"basic", "nodeadkeys"=>"nodeadkeys"); /* try to read additional keyboard layouts */ @@ -198,31 +193,42 @@ class workservice extends plugin switch ($name){ case 'gotoXResolution': - $this->XResolutions= array_merge(array('default' => _("inherited").' ['.$attrs[$name][0].']' ), $this->XResolutions); + $this->XResolutions= array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XResolutions; break; case 'gotoXColordepth': - $this->XColordepths= array_merge(array('default' => _("inherited").' ['.$attrs[$name][0].' '._('Bit').']'), $this->XColordepths); + $this->XColordepths= array('default' => _("inherited").' ['.$attrs[$name][0].' '._('Bit').']') + $this->XColordepths; break; case 'gotoXKbModel': - $this->XKbModels= array_merge(array('default' => _("inherited").' ['.$attrs[$name][0].']'), $this->XKbModels); + $this->XKbModels= array('default' => _("inherited").' ['.$attrs[$name][0].']') + $this->XKbModels; break; case 'gotoXKbLayout': - $this->XKbLayouts= array_merge(array('default' => _("inherited").' ['.$attrs[$name][0].']' ), $this->XKbLayouts); + $this->XKbLayouts= array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XKbLayouts; break; case 'gotoXKbVariant': - $this->XKbVariants= array_merge(array('default' => _("inherited").' ['.$attrs[$name][0].']' ), $this->XKbVariants); + $this->XKbVariants= array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XKbVariants; break; case 'gotoXMouseType': - $this->MouseTypes= array_merge(array('AUTO' => _("inherited").' ['.$attrs[$name][0].']' ), $this->MouseTypes); + $this->MouseTypes= array('AUTO' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->MouseTypes; break; case 'gotoXMouseport': - $this->MousePorts= array_merge(array('AUTO' => _("inherited").' ['.$attrs[$name][0].']' ), $this->MousePorts); + $this->MousePorts= array('AUTO' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->MousePorts; break; } } } + + /* Workaround to fill in inherited values if we've specified an objectclass */ + if (isset($_SESSION['SelectedSystemType']['ogroup']) && $_SESSION['SelectedSystemType']['ogroup'] != 'none'){ + $this->XResolutions= array('default' => _("inherited")); + $this->XColordepths= array('default' => _("inherited")); + $this->XKbModels= array('default' => _("inherited")); + $this->XKbLayouts= array('default' => _("inherited")); + $this->XKbVariants= array('default' => _("inherited")); + $this->MouseTypes= array('AUTO' => _("inherited")); + $this->MousePorts= array('AUTO' => _("inherited")); + } } function execute() @@ -310,8 +316,10 @@ class workservice extends plugin if($this->AutoSync){ $smarty->assign("AutoSyncCHK"," checked "); + $smarty->assign("hiddenState"," disabled "); }else{ $smarty->assign("AutoSyncCHK"," "); + $smarty->assign("hiddenState",""); } /* Show main page */ @@ -328,7 +336,7 @@ class workservice extends plugin { plugin::save_object(); - if(isset($_POST['gotoXHsync'])){ + if(isset($_POST['gotoXDriver']) && chkacl($this->acl,"AutoSync") == ""){ if(isset($_POST['AutoSync'])){ $this->AutoSync = true; }else{ @@ -346,36 +354,41 @@ class workservice extends plugin /* Default entries can use blank hsync/vsync entries */ if ($this->dn != "" && $this->cn != "default" && $this->cn != "wdefault"){ - /* 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."); + /* But only if no auto sync is enabled... */ + if (!$this->AutoSync){ + + /* 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."); + } } } - } - /* 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."); + /* 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."); + } } } } } + return ($message); } @@ -402,8 +415,8 @@ class workservice extends plugin } if($this->AutoSync){ - $this->attrs['gotoXHsync'] = preg_replace("/-/","+",$this->attrs['gotoXHsync']) ; - $this->attrs['gotoXVsync'] = preg_replace("/-/","+",$this->attrs['gotoXVsync']) ; + $this->attrs['gotoXHsync'] = "30+55"; + $this->attrs['gotoXVsync'] = "50+70"; } /* Write back to ldap */