X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=inline;f=plugins%2Fadmin%2Fsystems%2Fclass_workstationService.inc;h=c80b799fba8e8fe22e1027895e2573d1265df4e1;hb=82b212dba42b8bb340cb2689f7b9b009604940dd;hp=7aa47a4744477d7c1af416bda8b791aff7ef705d;hpb=242dfca5e1bbd09959c2038936e1f3d6925926db;p=gosa.git diff --git a/plugins/admin/systems/class_workstationService.inc b/plugins/admin/systems/class_workstationService.inc index 7aa47a474..c80b799fb 100644 --- a/plugins/admin/systems/class_workstationService.inc +++ b/plugins/admin/systems/class_workstationService.inc @@ -15,6 +15,7 @@ class workservice extends plugin var $gotoXColordepth= ""; var $gotoXHsync= ""; var $gotoXVsync= ""; + var $AutoSync = false; var $gotoXKbModel= ""; var $gotoXKbLayout= ""; var $gotoXKbVariant= ""; @@ -51,7 +52,7 @@ class workservice extends plugin /* attribute list for save action */ - var $attributes= array("cn","gotoXMonitor", + var $attributes= array("gotoXMonitor", "gotoXDriver", "gotoXResolution", "gotoXColordepth", "gotoXHsync", "gotoXVsync", "gotoScannerEnable", "gotoScannerClients", @@ -104,12 +105,21 @@ class workservice extends plugin } } + if(preg_match("/\+/",$this->gotoXHsync)){ + $this->AutoSync = true; + $this->gotoXHsync = preg_replace("/\+/","-",$this->gotoXHsync); + $this->gotoXVsync = preg_replace("/\+/","-",$this->gotoXVsync); + } + $this->hardware_list["automatic"]= _("automatic"); ksort($this->hardware_list); } function execute() { + /* Call parent execute */ + plugin::execute(); + /* Do we need to flip is_account state? */ if (isset($_POST['modify_state'])){ $this->is_account= !$this->is_account; @@ -183,28 +193,37 @@ 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 "); + }else{ + $smarty->assign("AutoSyncCHK"," "); + } /* Show main page */ - return($smarty->fetch (get_template_path('workstationService.tpl', TRUE))); + return($smarty->fetch (get_template_path('workstationService.tpl',TRUE,dirname(__FILE__)))); } function remove_from_parent() { - $ldap= $this->config->get_ldap_link(); - $ldap->rmdir($this->dn); - show_ldap_error($ldap->get_error()); - $this->handle_post_events("remove"); + $this->handle_post_events("remove"); } - /* Save data to object */ function save_object() { plugin::save_object(); + if(isset($_POST['gotoXHsync'])){ + if(isset($_POST['AutoSync'])){ + $this->AutoSync = true; + }else{ + $this->AutoSync = false; + } + } } - /* Check supplied data */ function check() { @@ -215,12 +234,12 @@ class workservice extends plugin /* Check vsync for correct usage */ $val= preg_replace ("/\s/", "", $this->gotoXVsync); - if (!preg_match ("/^\d+(\.\d+)?(\-\d+(\.\d+)?)?$/", $val) + 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); + list($v1,$v2)= preg_split ("/[-+]/", $val); if ($v2 != ""){ if ($v1 > $v2){ $message[]= _("Please specify a valid VSync range."); @@ -230,12 +249,12 @@ class workservice extends plugin /* Check hsync for correct usage */ $val= preg_replace ("/\s/", "", $this->gotoXHsync); - if (!preg_match ("/^\d+(\.\d+)?(\-\d+(\.\d+)?)?$/", $val) + 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); + list($v1,$v2)= preg_split ("/[-+]/", $val); if ($v2 != ""){ if ($v1 > $v2){ $message[]= _("Please specify a valid HSync range."); @@ -263,6 +282,11 @@ class workservice extends plugin } } + if($this->AutoSync){ + $this->attrs['gotoXHsync'] = preg_replace("/-/","+",$this->attrs['gotoXHsync']) ; + $this->attrs['gotoXVsync'] = preg_replace("/-/","+",$this->attrs['gotoXVsync']) ; + } + /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn);