Converted all pages the use the new Webmin UI library, for a more consistent look and layout.
---- Changes since 1.500 ----
Added a field for editing the maximum login attempts per connection.
+---- Changes since 1.520 ----
+Added support for listening on IPv6 addresses.
foreach $l (@listens, { }) {
local ($a, $p) = $l->{'values'}->[0] =~ /^(.*):(\d+)$/ ?
($1, $2) : ($l->{'values'}->[0]);
+ $amode = $a eq "::" ? 2 : $a eq "0.0.0.0" ? 1 :
+ $a eq "" ? 0 : 3;
push(@table, [
- &ui_textbox("address_$i", $a, 25),
+ &ui_select("mode_$i", $amode,
+ [ [ 0, " " ],
+ [ 1, $text{'net_all4'} ],
+ [ 2, $text{'net_all6'} ],
+ [ 3, $text{'net_sel'} ] ])." ".
+ &ui_textbox("address_$i", $amode == 3 ? $a : "", 25),
&ui_opt_textbox("port_$i", $p, 6, $text{'default'})
]);
$i++;
net_title=Networking
net_header=Networking options
net_port=Listen on port
+net_all4=All IPv4 addresses
+net_all6=All IPv6 addresses
+net_sel=Address..
net_prots=Accept protocols
net_prots_1=SSH v1
net_prots_2=SSH v2
&save_directive("HostName", $conf);
}
else {
- &check_ipaddress($in{'hostname'}) ||
- gethostbyname($in{'hostname'}) ||
+ &to_ipaddress($in{'hostname'}) ||
+ &to_ip6address($in{'hostname'}) ||
&error($text{'host_ehostname'});
&save_directive("HostName", $conf, $in{'hostname'});
}
&save_directive("ListenAddress", $conf);
}
else {
- for($i=0; defined($a = $in{"address_$i"}); $i++) {
- next if (!$a);
- &check_ipaddress($a) || gethostbyname($a) ||
- &error(&text('net_eladdress', $a));
+ for($i=0; defined($in{"mode_$i"}); $i++) {
+ next if ($in{"mode_$i"} == 0);
+ if ($in{"mode_$i"} == 1) {
+ $a = "0.0.0.0";
+ }
+ elsif ($in{"mode_$i"} == 2) {
+ $a = "::";
+ }
+ elsif ($in{"mode_$i"} == 3) {
+ $a = $in{"address_$i"};
+ &check_ipaddress($a) || &check_ip6address($a) ||
+ &error(&text('net_eladdress', $a));
+ }
if ($in{"port_${i}_def"}) {
push(@listens, $a);
}
}
else {
&check_ipaddress($in{'listen'}) ||
- ($version{'number'} >= 2 && gethostbyname($in{'listen'})) ||
+ ($version{'number'} >= 2 && &to_ipaddress($in{'listen'})) ||
&error($text{'net_elisten'});
&save_directive("ListenAddress", $conf, $in{'listen'});
}