log_add_group=Added cluster servers from group $1
log_delete_host=Removed cluster server $1
log_delete_group=Removed $1 cluster servers
+log_openports=Opened firewall ports $1
setup_eiface=No external network interface entered
setup_ecannot=You are not allowed to setup the firewall
$port = "*";
}
push(@sockets, [ $ip, $port ]);
+ push(@ports, $port) if ($port && $port ne "*");
}
@sockets || &error($text{'bind_enone'});
$in{'listen_def'} || $in{'listen'} =~ /^\d+$/ || &error($text{'bind_elisten'});
&system_logged("$config_directory/start >/dev/null 2>&1 </dev/null");
&error(&text('bind_erestart', $out));
}
+
+# If possible, open the new ports
+if (&foreign_check("firewall") && $in{'firewall'}) {
+ @oldports = split(/\s+/, $in{'oldports'});
+ @newports = &unique(grep { &indexof($_, @oldports) < 0 } @ports);
+ if (@newports) {
+ &clean_environment();
+ $ENV{'WEBMIN_CONFIG'} = $config_directory;
+ &system_logged(&module_root_directory("firewall").
+ "/open-ports.pl ".
+ join(" ", map { $_.":".($_+10) } @newports).
+ " >/dev/null 2>&1");
+ &reset_environment();
+ }
+ }
+
&webmin_log("bind", undef, undef, \%in);
+# Work out redirect URL
if ($miniserv{'musthost'}) { $miniserv{'musthost'}; }
elsif ($miniserv{'bind'}) { $url = $miniserv{'bind'}; }
else { $url = $ENV{'SERVER_NAME'}; }
# Show table of all bound IPs and ports
$stable = &ui_columns_start([ $text{'bind_sip'}, $text{'bind_sport'} ]);
-$i = 0;
-foreach $s (@sockets, [ undef, "*" ]) {
+my $i = 0;
+my @ports;
+foreach my $s (@sockets, [ undef, "*" ]) {
# IP address
my @cols;
push(@cols, &ui_select("ip_def_$i", $s->[0] eq "" ? 0 :
[ 1, $text{'bind_sport1'} ] ])." ".
&ui_textbox("port_$i", $s->[1] eq "*" ? undef : $s->[1],5));
$stable .= &ui_columns_row(\@cols, [ "nowrap", "nowrap" ]);
+ push(@ports, $s->[1]) if ($s->[1] && $s->[1] ne "*");
$i++;
}
$stable .= &ui_columns_end();
+if (&foreign_check("firewall")) {
+ print &ui_hidden("oldports", join(" ", @ports));
+ $stable .= &ui_checkbox("firewall", 1, $text{'bind_firewall'}, 1);
+ }
print &ui_table_row($text{'bind_sockets'}, $stable);
# IPv6 enabled?
bind_desc2=This form can be used to change the port number that Webmin listens on, or have it listen on only a single IP address on your system. You can also configure it to accept connections on multiple ports, or to listen on several IP addresses. Note - your web browser may prompt you to log in again after changing the port or binding address.
bind_header=IP addresses and ports
bind_sockets=Listen on IPs and ports
+bind_firewall=Open new ports on firewall?
bind_sip=Bind to IP address
bind_sport=Listen on port
bind_sip1=Any address