From c4e940d0576baf2218fa8fc3bcb05bc2adbbb5f3 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 29 Jan 2008 09:42:44 +0000 Subject: [PATCH] Updated gotoXdmcp server settings. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8629 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/goto/class_terminalService.inc | 36 +++++++++++++++++-- .../admin/systems/goto/terminalService.tpl | 2 +- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc index b48beded0..ec1dd12ac 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc @@ -336,16 +336,35 @@ class termservice extends plugin $smarty->assign("XKbLayoutKeys",array_flip($this->XKbLayouts)); $smarty->assign("nfsservers", $this->config->data['SERVERS']['NFS']); - + + /* Create a list of useable servers for the currently selected + * connection type. + */ $xdmcp_types = $this->config->data['SERVERS']['TERMINAL_SESSION_TYPES']; $available_servers = array(); if(isset($xdmcp_types[strtoupper($this->gotoXMethod)])){ $available_servers = $xdmcp_types[strtoupper($this->gotoXMethod)]; } + + /* Append additional information to invalid server selections. + */ $tmp = array(); foreach($this->selected_xdmcp_servers as $server){ - $tmp[] = $server; + if(in_array($server,$available_servers)){ + $tmp[$server] = $server; + }else{ + $tmp[$server] = $server." - "._("Unsupported"); + } } + + /* Remove already selected servers from available list. + */ + foreach($available_servers as $key => $server){ + if(isset($tmp[$server])){ + unset($available_servers[$key]); + } + } + $smarty->assign("selected_xdmcp_servers", $tmp); $smarty->assign("inherited_xdmcp_servers", $this->inherited_xdmcp_servers); $smarty->assign("available_xdmcp_servers", $available_servers); @@ -484,6 +503,19 @@ class termservice extends plugin { /* Call common method to give check the hook */ $message= plugin::check(); + + $xdmcp_types = $this->config->data['SERVERS']['TERMINAL_SESSION_TYPES']; + $available_servers = array(); + if(isset($xdmcp_types[strtoupper($this->gotoXMethod)])){ + $available_servers = $xdmcp_types[strtoupper($this->gotoXMethod)]; + } + foreach($this->selected_xdmcp_servers as $server){ + if(!in_array($server,$available_servers)){ + $message[] = _("Remote desktop settings contains servers that do not support the selected connection method."); + break; + } + } + return ($message); } diff --git a/gosa-plugins/goto/admin/systems/goto/terminalService.tpl b/gosa-plugins/goto/admin/systems/goto/terminalService.tpl index 8080d9ea5..750dcd57f 100644 --- a/gosa-plugins/goto/admin/systems/goto/terminalService.tpl +++ b/gosa-plugins/goto/admin/systems/goto/terminalService.tpl @@ -194,7 +194,7 @@ {if $gotoXMethod_select == "default"} {html_options values=$inherited_xdmcp_servers output=$inherited_xdmcp_servers} {else} - {html_options values=$selected_xdmcp_servers output=$selected_xdmcp_servers} + {html_options options=$selected_xdmcp_servers} {/if}
{/render} -- 2.30.2