Handle hostnames with upper-case letters
[webmin.git] / wuftpd / edit_net.cgi
1 #!/usr/local/bin/perl
2 # edit_net.cgi
3 # Display network-related options
4
5 require './wuftpd-lib.pl';
6 &ui_print_header(undef, $text{'net_title'}, "", "net");
7
8 $conf = &get_ftpaccess();
9 @class = &find_value("class", $conf);
10
11 print "<form action=save_net.cgi>\n";
12 print "<table border>\n";
13 print "<tr $tb> <td><b>$text{'net_header'}</b></td> </tr>\n";
14 print "<tr $cb> <td><table width=100%>\n";
15
16 # Display TCP window options
17 @tcp = ( &find_value('tcpwindow', $conf), [ ] );
18 print "<tr> <td valign=top><b>$text{'net_tcp'}</b></td>\n";
19 print "<td colspan=3><table border>\n";
20 print "<tr $tb> <td><b>$text{'net_tsize'}</b></td> ",
21       "<td><b>$text{'net_tclass'}</b></td> </tr>\n";
22 $i = 0;
23 foreach $t (@tcp) {
24         print "<tr $cb>\n";
25         print "<td><input name=tsize_$i size=5 value='$t->[0]'></td>\n";
26         print "<td><select name=tclass_$i>\n";
27         printf "<option value='' %s>%s\n",
28                 $t->[1] ? '' : 'checked', $text{'net_tall'};
29         foreach $c (@class) {
30                 printf "<option %s>%s\n",
31                         $t->[1] eq $c->[0] ? 'selected' : '', $c->[0];
32                 }
33         print "</select></td> </tr>\n";
34         $i++;
35         }
36 print "</table></td>\n";
37 print "<tr> <td colspan=4><hr></td> </tr>\n";
38
39 # passive address options
40 @pasv = ( ( grep { $_->[0] eq 'address' } &find_value('passive', $conf) ), [ ]);
41 print "<tr> <td valign=top><b>$text{'net_pasvaddr'}</b></td>\n";
42 print "<td colspan=3><table border>\n";
43 print "<tr $tb> <td><b>$text{'net_pip'}</b></td> ",
44       "<td><b>$text{'net_pcidr'}</b></td> </tr>\n";
45 $i = 0;
46 foreach $p (@pasv) {
47         print "<tr $cb>\n";
48         print "<td><input name=aip_$i size=15 value='$p->[1]'></td>\n";
49         local @ci = split(/\//, $p->[2]);
50         print "<td><input name=anet_$i size=15 value='$ci[0]'> /\n";
51         print "<input name=acidr_$i size=2 value='$ci[1]'></td>\n";
52         print "</tr>\n";
53         $i++;
54         }
55 print "</table></td></tr>\n";
56
57 # passive port options
58 @pasv = ( ( grep { $_->[0] eq 'ports' } &find_value('passive', $conf) ), [ ] );
59 print "<tr> <td valign=top><b>$text{'net_pasvport'}</b></td>\n";
60 print "<td colspan=3><table border>\n";
61 print "<tr $tb> <td><b>$text{'net_prange'}</b></td> ",
62       "<td><b>$text{'net_pcidr'}</b></td> </tr>\n";
63 $i = 0;
64 foreach $p (@pasv) {
65         print "<tr $cb>\n";
66         print "<td><input name=pmin_$i size=5 value='$p->[2]'> -\n";
67         print "<input name=pmax_$i size=5 value='$p->[3]'></td>\n";
68         local @ci = split(/\//, $p->[1]);
69         print "<td><input name=pnet_$i size=15 value='$ci[0]'> /\n";
70         print "<input name=pcidr_$i size=2 value='$ci[1]'></td>\n";
71         print "</tr>\n";
72         $i++;
73         }
74 print "</table></td></tr>\n";
75
76 print "</table></td></tr></table>\n";
77 print "<input type=submit value=\"$text{'save'}\"></form>\n";
78
79 &ui_print_footer("", $text{'index_return'});
80