X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fsystems%2Fclass_terminalService.inc;h=5a24d156a0a42366af1fc8367e8aab8e0ba5e6c1;hb=ea192ab4f2ec780c4e2f21820ba653c67da84bb3;hp=eb40ec0ac5c44ccb720c754a7bd8969211333db4;hpb=a46d6ee8b2480593941116e2f21051d729447c75;p=gosa.git diff --git a/plugins/admin/systems/class_terminalService.inc b/plugins/admin/systems/class_terminalService.inc index eb40ec0ac..5a24d156a 100644 --- a/plugins/admin/systems/class_terminalService.inc +++ b/plugins/admin/systems/class_terminalService.inc @@ -30,6 +30,8 @@ class termservice extends plugin var $gotoScannerBackend= ""; var $goFonHardware= "automatic"; + var $AutoSync = false; + /* Needed values and lists */ var $ignore_account= TRUE; var $base= ""; @@ -112,7 +114,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"); @@ -236,6 +238,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() @@ -324,6 +331,15 @@ class termservice extends plugin $smarty->assign ("hardware_list", $hl); $smarty->assign ("gotoXMonitor", $this->gotoXMonitor); + $smarty->assign("AutoSyncACL",$this->getacl("AutoSync")); + + $smarty->assign("AutoSyncCHK"," "); + if($this->AutoSync){ + $smarty->assign("AutoSyncCHK"," checked "); + $smarty->assign("gotoXVsyncACL", preg_replace("/w/","",$this->getacl("gotoXVsync"))); + $smarty->assign("gotoXHsyncACL", preg_replace("/w/","",$this->getacl("gotoXHsync"))); + } + /* Show main page */ return($smarty->fetch (get_template_path('terminalService.tpl', TRUE))); } @@ -351,49 +367,59 @@ class termservice extends plugin } } } - } - } + } - - /* Check supplied data */ - function check() - { - /* Call common method to give check the hook */ - $message= plugin::check(); + if(isset($_POST['gotoXDriver'])){ + if(isset($_POST['AutoSync'])){ + $this->AutoSync = true; + }else{ + $this->AutoSync = false; + } + } /* 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) - && $this->acl_is_writeable("gotoXVsync")){ - - $message[]= _("Please specify a valid VSync range."); - } elseif ($this->acl_is_writeable("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) && $this->acl_is_writeable("gotoXVsync")){ + + $message[]= _("Please specify a valid VSync range."); + } elseif ($this->acl_is_writeable("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) - && $this->acl_is_writeable("gotoXHsync")){ - - $message[]= _("Please specify a valid HSync range."); - } elseif ($this->acl_is_writeable("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) && $this->acl_is_writeable("gotoXHsync")){ + + $message[]= _("Please specify a valid HSync range."); + } elseif ($this->acl_is_writeable("gotoXHsync")){ + list($v1,$v2)= preg_split ("/[-+]/", $val); + if ($v2 != ""){ + if ($v1 > $v2){ + $message[]= _("Please specify a valid HSync range."); + } } } } } + } + + + /* Check supplied data */ + function check() + { + /* Call common method to give check the hook */ + $message= plugin::check(); return ($message); } @@ -417,6 +443,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); @@ -450,12 +481,13 @@ class termservice extends plugin "gotoXColordepth" => _("Gfx color depth"), "gotoXHsync" => _("Hsync"), "gotoXVsync" => _("Vsync"), + "AutoSync" => _("Auto-Sync"), "gotoLpdEnable" => _("Printer service enabled"), "gotoLpdServer" => _("Spool server"), "gotoScannerEnable" => _("Scanner enabled"), "gotoScannerModel" => _("Scanner model"), - "gotoScannerClients" => _(""), - "gotoScannerBackend" => _(""), + "gotoScannerClients" => _("Heäh ? "), + "gotoScannerBackend" => _("..."), "gotoXKbModel" => _("Keyboard model"), "gotoXKbLayout" => _("Keyboard layout"), "gotoXKbVariant" => _("Keyboard variant"),