X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fsystems%2Fclass_terminalService.inc;h=305c732248b287b472f48e8f32c2548339779504;hb=7f51b7c557fe5fb3c73b5bde15856fbfdb08efbb;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..305c73224 100644 --- a/plugins/admin/systems/class_terminalService.inc +++ b/plugins/admin/systems/class_terminalService.inc @@ -62,9 +62,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")."]"); @@ -193,6 +193,49 @@ class termservice extends plugin $this->hardware_list["automatic"]= _("automatic"); ksort($this->hardware_list); + + /* Convert gotoLpdEnable */ + $this->gotoLpdEnable= preg_match("/yes/",$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; + } + } + } } function execute() @@ -353,6 +396,9 @@ class termservice extends plugin /* Save to LDAP */ function save() { + /* Convert to string */ + $this->gotoLpdEnable= $this->gotoLpdEnable?"Yes":"No"; + plugin::save(); /* Strip out 'default' values */