3 # Display port / address form
5 require './webmin-lib.pl';
6 &ui_print_header(undef, $text{'bind_title'}, "");
7 &get_miniserv_config(\%miniserv);
9 print $text{'bind_desc'},"<p>\n";
11 print &ui_form_start("change_bind.cgi", "post");
12 print &ui_table_start($text{'bind_header'}, undef, 2, [ "width=30%" ]);
14 # Build list of sockets
15 @sockets = &get_miniserv_sockets(\%miniserv);
17 # Show table of all bound IPs and ports
18 $stable = &ui_columns_start([ $text{'bind_sip'}, $text{'bind_sport'} ]);
21 foreach my $s (@sockets, [ undef, "*" ]) {
24 push(@cols, &ui_select("ip_def_$i", $s->[0] eq "" ? 0 :
25 $s->[0] eq "*" ? 1 : 2,
27 [ 1, $text{'bind_sip1'} ],
28 [ 2, $text{'bind_sip2'} ] ])." ".
29 &ui_textbox("ip_$i", $s->[0] eq "*" ? undef : $s->[0], 20));
32 push(@cols, &ui_select("port_def_$i", $s->[1] eq "*" ? 0 : 1,
33 [ $i ? ( [ 0, $text{'bind_sport0'} ] ) : ( ),
34 [ 1, $text{'bind_sport1'} ] ])." ".
35 &ui_textbox("port_$i", $s->[1] eq "*" ? undef : $s->[1],5));
36 $stable .= &ui_columns_row(\@cols, [ "nowrap", "nowrap" ]);
37 push(@ports, $s->[1]) if ($s->[1] && $s->[1] ne "*");
40 $stable .= &ui_columns_end();
41 if (&foreign_check("firewall")) {
42 print &ui_hidden("oldports", join(" ", @ports));
43 $stable .= &ui_checkbox("firewall", 1, $text{'bind_firewall'}, 1);
45 print &ui_table_row($text{'bind_sockets'}, $stable);
48 print &ui_table_row($text{'bind_ipv6'},
49 &ui_yesno_radio("ipv6", $miniserv{'ipv6'}));
51 # Show UDP listen address
52 print &ui_table_row($text{'bind_listen'},
53 &ui_radio("listen_def", $miniserv{"listen"} ? 0 : 1,
54 [ [ 1, $text{'bind_none'} ],
55 [ 0, &ui_textbox("listen", $miniserv{"listen"}, 6) ] ]));
57 # Show web server hostname
58 print &ui_table_row($text{'bind_hostname'},
59 &ui_radio("hostname_def", $miniserv{"host"} ? 0 : 1,
60 [ [ 1, $text{'bind_auto'} ],
61 [ 0, &ui_textbox("hostname", $miniserv{"host"}, 25) ] ]));
63 # Reverse-lookup hostname
64 print &ui_table_row($text{'bind_resolv_myname'},
65 &ui_radio("no_resolv_myname", int($miniserv{'no_resolv_myname'}),
66 [ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ]));
68 print &ui_table_end();
69 print &ui_form_end([ [ "save", $text{'save'} ] ]);
71 &ui_print_footer("", $text{'index_return'});