diff --git a/sshd/edit_net.cgi b/sshd/edit_net.cgi index 6a6258317..50e6c964d 100755 --- a/sshd/edit_net.cgi +++ b/sshd/edit_net.cgi @@ -6,13 +6,12 @@ require './sshd-lib.pl'; &ui_print_header(undef, $text{'net_title'}, "", "net"); $conf = &get_sshd_config(); -print "
\n"; -print "\n"; -print "\n"; -print "
$text{'net_header'}
\n"; +print &ui_form_start("save_net.cgi", "post"); +print &ui_table_start($text{'net_header'}, "width=100%", 2); if ($version{'type'} eq 'openssh' && $version{'number'} >= 3) { # Multiple listen addresses supported + # XXX &scmd(1); @listens = &find("ListenAddress", $conf); print "\n"; @@ -43,86 +42,59 @@ if ($version{'type'} eq 'openssh' && $version{'number'} >= 3) { } else { # Just one listen address - &scmd(); $listen = &find_value("ListenAddress", $conf); $listen = "" if ($listen eq "0.0.0.0"); - print "\n"; - &ecmd(); + print &ui_table_row($text{'net_listen'}, + &ui_opt_textbox("listen", $listen, 20,$text{'net_listen_def'})); } -&scmd(); +# Default port(s) @ports = &find("Port", $conf); $port = join(" ", map { $_->{'values'}->[0] } @ports); -print "\n"; -&ecmd(); +print &ui_table_row($text{'net_port'}, + &ui_opt_textbox("port", $port, 15, $text{'default'}." (22)")); if ($version{'type'} eq 'openssh' && $version{'number'} >= 2) { - &scmd(); + # Protocols $prots = &find_value("Protocol", $conf); @prots = $prots ? split(/,/, $prots) : $version{'number'} >= 2.9 ? (1, 2) : (1); - print "\n"; - &ecmd(); + print &ui_table_row($text{'net_prots'}, $cbs); } if ($version{'type'} eq 'ssh' && ($version{'number'} < 2 || $version{'number'} >= 3)) { - &scmd(); + # Idle connection timeout $idle = &find_value("IdleTimeout", $conf); if ($idle =~ /^(\d+)([smhdw])$/i) { $idle = $1; $units = $2; } - print "\n"; - &ecmd(); + print &ui_table_row($text{'net_idle'}, + &ui_radio("idle_def", $idle ? 0 : 1, + [ [ 1, $text{'default'} ], + [ 0, &ui_textbox("idle", $idle", 6)." ". + &ui_select("idle_units", $units, + [ map { [ $_, $text{"net_idle_".$_} ] } + ('s', 'm', 'h', 'd', 'w') ]) ] ])); } -&scmd(); +# Send keepalive packets? $keep = &find_value("KeepAlive", $conf); -print "\n", - lc($keep) eq 'no' ? "checked" : "", $text{'no'}; -&ecmd(); +print &ui_table_row($text{'net_keep'}, + &ui_yesno_radio("keep", lc($keep) ne 'no')); -&scmd(); +# Grace time for logins $grace = &find_value("LoginGraceTime", $conf); -print "\n"; -&ecmd(); +print &ui_table_row($text{'net_grace'}, + &ui_opt_textbox("grace", $grace, 6, $text{'net_grace_def'})." ". + $text{'net_grace_s'}); +# XXX if ($version{'type'} ne 'openssh' || $version{'number'} >= 2) { &scmd(); $tcp = &find_value("AllowTcpForwarding", $conf);
$text{'net_listen2'}$text{'net_listen'} \n"; - printf " %s\n", - $listen ? "" : "checked", $text{'net_listen_def'}; - printf "\n", - $listen ? "checked" : ""; - print "$text{'net_port'} \n"; -printf " %s (22)\n", - $port ? "" : "checked", $text{'default'}; -printf "\n", - $port ? "checked" : ""; -print "$text{'net_prots'} \n"; + $cbs = ""; foreach $p (1, 2) { - printf " %s\n", - $p, &indexof($p, @prots) >= 0 ? "checked" : "", - $text{"net_prots_$p"}; + $cbs .= &ui_checkbox("prots", $p, &indexof($p, @prots) >= 0, + $text{"net_prots_$p"})." "; } - print "$text{'net_idle'} \n"; - printf " %s\n", - $idle ? "" : "checked", $text{'default'}; - printf "\n", - $idle ? "checked" : ""; - print "\n"; - print "$text{'net_keep'} \n"; -printf " %s\n", - lc($keep) eq 'no' ? "" : "checked", $text{'yes'}; -printf " %s$text{'net_grace'} \n"; -printf " %s\n", - $grace ? "" : "checked", $text{'net_grace_def'}; -printf "\n", - $grace ? "checked" : ""; -print " $text{'net_grace_s'}