From: hickert Date: Thu, 23 Nov 2006 05:24:08 +0000 (+0000) Subject: Added H/V Sync behavior from workstation-service to terminal-service. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1f9f06a67fbcb6e688505e25a8fd0dade5594000;p=gosa.git Added H/V Sync behavior from workstation-service to terminal-service. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5199 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_terminalService.inc b/plugins/admin/systems/class_terminalService.inc index 1d4ae885a..4e3a5f07d 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; @@ -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; + } } + } @@ -355,6 +380,45 @@ class termservice extends plugin { /* Call common method to give check the hook */ $message= plugin::check(); + + /* Default entries can use blank hsync/vsync entries */ + 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)= preg_split ("/[-+]/", $val); + if ($v2 != ""){ + if ($v1 > $v2){ + $message[]= _("Please specify a valid HSync range."); + } + } + } + } + } + return ($message); } @@ -378,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); diff --git a/plugins/admin/systems/terminalService.tpl b/plugins/admin/systems/terminalService.tpl index db8fc0e29..24de0165e 100644 --- a/plugins/admin/systems/terminalService.tpl +++ b/plugins/admin/systems/terminalService.tpl @@ -120,14 +120,19 @@ {t}Type{/t} {$gotoXMonitor} + + + {t}Use DDC for automatic detection{/t} + + - kHz - Hz