X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fsystems%2Fclass_terminalService.inc;h=2be95df7957e78c00dc78fec861bde405badcf05;hb=7a6a428eb1c6534e448094d51bc6a542fe832bb9;hp=5a8018c615d9f353d0af11263cca083927a99765;hpb=fc812fcb4eb576a98fcea925d49853516ecbd32a;p=gosa.git diff --git a/plugins/admin/systems/class_terminalService.inc b/plugins/admin/systems/class_terminalService.inc index 5a8018c61..2be95df79 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= ""; @@ -62,9 +64,9 @@ class termservice extends plugin var $objectclasses= array("GOhard"); - function termservice ($config, $dn= NULL) + function termservice ($config, $dn= NULL, $parent= NULL) { - plugin::plugin ($config, $dn); + plugin::plugin ($config, $dn, $parent); array_unshift($this->XDrivers, "["._("unknown")."]"); @@ -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"); @@ -193,6 +195,58 @@ class termservice extends plugin $this->hardware_list["automatic"]= _("automatic"); ksort($this->hardware_list); + + /* Convert gotoLpdEnable */ + $this->gotoLpdEnable= preg_match("/yes/i",$this->gotoLpdEnable); + + /* Load hardware list */ + $ldap= $this->config->get_ldap_link(); + $ldap->cd($this->config->current['BASE']); + $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))"); + if ($ldap->count() == 1){ + $map= array("gotoXResolution", "gotoXColordepth", "gotoXKbModel", "gotoXKbLayout", + "gotoXKbVariant", "gotoXMouseType", "gotoXMouseport"); + $attrs= $ldap->fetch(); + + foreach ($map as $name){ + if (!isset($attrs[$name][0])){ + continue; + } + + switch ($name){ + case 'gotoXResolution': + $this->XResolutions['default'] = _("inherited").' ['.$attrs[$name][0].']' ; + break; + case 'gotoXColordepth': + $this->XColordepths['default'] = _("inherited").' ['.$attrs[$name][0].' '._('Bit').']'; + break; + case 'gotoXKbModel': + $this->XKbModels['default'] = _("inherited").' ['.$attrs[$name][0].']'; + break; + case 'gotoXKbLayout': + $this->XKbLayouts['default'] = _("inherited").' ['.$attrs[$name][0].']'; + break; + case 'gotoXKbVariant': + $this->XKbVariants['default'] = _("inherited").' ['.$attrs[$name][0].']' ; + break; + case 'gotoXMouseType': + $this->MouseTypes['AUTO'] = _("inherited").' ['.$attrs[$name][0].']' ; + break; + case 'gotoXMouseport': + $this->MousePorts['AUTO'] = _("inherited").' ['.$attrs[$name][0].']' ; + break; + } + } + } + if(preg_match("/\+/",$this->gotoXHsync)){ + $this->AutoSync = true; + $this->gotoXHsync = preg_replace("/\+/","-",$this->gotoXHsync); + $this->gotoXVsync = preg_replace("/\+/","-",$this->gotoXVsync); + } + + if($this->is_account){ + @log::log("view","terminal/".get_class($this),$this->dn); + } } function execute() @@ -215,6 +269,13 @@ class termservice extends plugin /* Show main page */ $smarty= get_smarty(); + /* Assign acls */ + $tmp= $this->plInfo(); + foreach($tmp['plProvidedAcls'] as $name => $translation){ + $smarty->assign($name."ACL",$this->getacl($name)); + } + + /* Arrays */ foreach(array("XMethods", "XDrivers", "XResolutions", "XColordepths", "gotoScannerModels", "XKbModels","XKbVariants", @@ -236,13 +297,11 @@ class termservice extends plugin "gotoXKbVariant", "gotoXMouseType", "gotoXMouseport") as $val){ $smarty->assign($val."_select", $this->$val); - $smarty->assign($val."ACL", chkacl($this->acl, $val)); } /* Variables */ foreach(array("gotoXHsync", "gotoXVsync") as $val){ $smarty->assign($val, $this->$val); - $smarty->assign($val."ACL", chkacl($this->acl, $val)); } $smarty->assign("staticAddress", ""); @@ -253,14 +312,12 @@ class termservice extends plugin } else { $smarty->assign("$val", ""); } - $smarty->assign($val."ACL", chkacl($this->acl, "gotoLpdEnable")); } /* Phone stuff */ $smarty->assign ("goFonHardware", $this->goFonHardware); $hl= "