diff --git a/plugins/admin/systems/class_workstationService.inc b/plugins/admin/systems/class_workstationService.inc
index 495e8dd370420f980d3e8dcc70670cfbf40259d5..c80b799fba8e8fe22e1027895e2573d1265df4e1 100644 (file)
var $gotoXColordepth= "";
var $gotoXHsync= "";
var $gotoXVsync= "";
+ var $AutoSync = false;
var $gotoXKbModel= "";
var $gotoXKbLayout= "";
var $gotoXKbVariant= "";
}
}
+ 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;
$hl.= "</select>\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,dirname(__FILE__))));
function remove_from_parent()
{
- /* This is not necessary, i think
- * Remove should be called from workGeneric ...
- */
- /*$ldap= $this->config->get_ldap_link();
- $ldap->rmdir($this->dn);
- show_ldap_error($ldap->get_error());
- $this->handle_post_events("remove");
- */
-
- /* This only removes the attributes from this tab,
- * and not hte whole entry
- */
- $ldap= $this->config->get_ldap_link();
- plugin::remove_from_parent();
- $ldap->cd($this->dn);
- $ldap->modify($this->attrs);
- show_ldap_error($ldap->get_error());}
-
+ $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()
{
/* 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.");
/* 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.");
}
}
+ 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);