3 # Display port / address form
5 require './usermin-lib.pl';
6 $access{'bind'} || &error($text{'acl_ecannot'});
7 &ui_print_header(undef, $text{'bind_title'}, "");
8 &get_usermin_miniserv_config(\%miniserv);
10 print $text{'bind_desc2'},"<p>\n";
12 print &ui_form_start("change_bind.cgi", "post");
13 print &ui_table_start($text{'bind_header'}, undef, 2, [ "width=30%" ]);
15 # Build list of sockets
16 my @sockets = &webmin::get_miniserv_sockets(\%miniserv);
18 # Show table of all bound IPs and ports
19 my $stable = &ui_columns_start([ $text{'bind_sip'}, $text{'bind_sport'} ]);
21 foreach $s (@sockets, [ undef, "*" ]) {
24 push(@cols, &ui_select("ip_def_$i",
26 $s->[0] eq "*" ? 1 : 2,
28 [ 1, $text{'bind_sip1'} ],
29 [ 2, $text{'bind_sip2'} ] ])." ".
31 $s->[0] eq "*" ? undef : $s->[0], 20));
34 push(@cols, &ui_select("port_def_$i", $s->[1] eq "*" ? 0 : 1,
35 [ $i ? ( [ 0, $text{'bind_sport0'} ] ) : ( ),
36 [ 1, $text{'bind_sport1'} ] ])." ".
37 &ui_textbox("port_$i", $s->[1] eq "*" ? undef : $s->[1],5));
38 $stable .= &ui_columns_row(\@cols, [ "nowrap", "nowrap" ]);
41 $stable .= &ui_columns_end();
42 print &ui_table_row($text{'bind_sockets'}, $stable);
45 print &ui_table_row($webmin::text{'bind_ipv6'},
46 &ui_yesno_radio("ipv6", $miniserv{'ipv6'}));
48 # Show web server hostname
49 print &ui_table_row($text{'bind_hostname'},
50 &ui_radio("hostname_def", $miniserv{"host"} ? 0 : 1,
51 [ [ 1, $text{'bind_auto'} ],
52 [ 0, &ui_textbox("hostname", $miniserv{"host"}, 25) ] ]));
54 print &ui_table_end();
55 print &ui_form_end([ [ "save", $text{'save'} ] ]);
57 &ui_print_footer("", $text{'index_return'});