X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fsystems%2Fclass_terminalService.inc;h=8f111206236eb5de0287d1b877e39ae059e61b62;hb=e1caeaac864e3118ac900e3fc2d697bd88da1326;hp=4beecf9e0d14c0ebbc70c4dff2336a3bb3235264;hpb=492133654424affe573db29aba364fdd8bdb3c83;p=gosa.git diff --git a/plugins/admin/systems/class_terminalService.inc b/plugins/admin/systems/class_terminalService.inc index 4beecf9e0..8f1112062 100644 --- a/plugins/admin/systems/class_terminalService.inc +++ b/plugins/admin/systems/class_terminalService.inc @@ -29,6 +29,7 @@ class termservice extends plugin var $gotoScannerClients= ""; var $gotoScannerBackend= ""; var $goFonHardware= "automatic"; + var $AutoSync = false; /* Needed values and lists */ var $ignore_account= TRUE; @@ -112,7 +113,7 @@ class termservice extends plugin $this->XKbModels[$type] = $type; } - /* Additional values will be extracted from /etc/gosa/keyboardLayouts */ + /* Additional values will be extracted from CONFIG_DIR./keyboardLayouts */ $this->XKbLayouts= array ("default"=>"["._("inherited")."]","de"=> "de","intl" =>"intl","us" =>"us"); $this->XKbVariants= array ("default"=>"["._("inherited")."]", "nodeadkeys"=>"nodeadkeys", "basic"=>"basic"); @@ -195,7 +196,7 @@ class termservice extends plugin ksort($this->hardware_list); /* Convert gotoLpdEnable */ - $this->gotoLpdEnable= ($this->gotoLpdEnable == "Yes"); + $this->gotoLpdEnable= preg_match("/yes/i",$this->gotoLpdEnable); /* Load hardware list */ $ldap= $this->config->get_ldap_link(); @@ -236,6 +237,11 @@ class termservice extends plugin } } } + if(preg_match("/\+/",$this->gotoXHsync)){ + $this->AutoSync = true; + $this->gotoXHsync = preg_replace("/\+/","-",$this->gotoXHsync); + $this->gotoXVsync = preg_replace("/\+/","-",$this->gotoXVsync); + } } function execute() @@ -321,6 +327,17 @@ class termservice extends plugin $smarty->assign ("hardware_list", $hl); $smarty->assign ("gotoXMonitor", $this->gotoXMonitor); + $smarty->assign("AutoSyncACL",chkacl($this->acl,"AutoSync")); + + if($this->AutoSync){ + $smarty->assign("AutoSyncCHK"," checked "); + $smarty->assign("hiddenState"," disabled "); + }else{ + $smarty->assign("AutoSyncCHK"," "); + $smarty->assign("hiddenState",""); + } + + /* Show main page */ return($smarty->fetch (get_template_path('terminalService.tpl', TRUE))); } @@ -346,7 +363,15 @@ class termservice extends plugin $this->$val= TRUE; } } + } + if(isset($_POST['gotoXDriver'])){ + if(isset($_POST['AutoSync'])){ + $this->AutoSync = true; + }else{ + $this->AutoSync = false; + } } + } @@ -357,38 +382,43 @@ class termservice extends plugin $message= plugin::check(); /* 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)= split ("-", $val); - if ($v2 != ""){ - if ($v1 > $v2){ - $message[]= _("Please specify a valid VSync range."); + if ($this->dn != "" && $this->cn != "default" && $this->cn != "default"){ + + /* 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)= 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); } @@ -412,6 +442,11 @@ class termservice extends plugin } } + if($this->AutoSync){ + $this->attrs['gotoXHsync'] = "30+55"; + $this->attrs['gotoXVsync'] = "50+70"; + } + /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn);