Handle hostnames with upper-case letters
[webmin.git] / frox / edit_acl.cgi
1 #!/usr/local/bin/perl
2 # Show access control options
3
4 require './frox-lib.pl';
5 &ui_print_header(undef, $text{'acl_title'}, "");
6 $conf = &get_config();
7
8 print &ui_form_start("save_acl.cgi", "post");
9 print &ui_table_start($text{'acl_header'}, "width=100%", 4);
10
11 print &config_opt_textbox($conf, "Timeout", 5);
12
13 print &config_opt_textbox($conf, "MaxForks", 5);
14
15 print &config_opt_textbox($conf, "MaxForksPerHost", 5);
16
17 print &config_opt_textbox($conf, "MaxTransferRate", 5, 1, $text{'acl_bps'});
18
19 print &config_yesno($conf, "DoNTP", undef, undef, "no");
20
21 print &ui_table_row("", "");
22
23 print &config_opt_textbox($conf, "NTPAddress", 30, 3, $text{'acl_same'});
24
25 print &ui_table_hr();
26
27 @acl = &find("ACL", $conf);
28 $table = "<table border width=100%>\n".
29          "<tr $tb> ".
30          "<td><b>$text{'acl_action'}</b></td> ".
31          "<td><b>$text{'acl_src'}</b></td> ".
32          "<td><b>$text{'acl_dest'}</b></td> ".
33          "<td><b>$text{'acl_ports'}</b></td> ".
34          "</tr>\n";
35 $i = 0;
36 foreach $a (@acl, { }, { }, { }) {
37         $table .= "<tr $cb>\n";
38         $table .= "<td>".&ui_select("action_$i",
39                                     $a->{'words'}->[0],
40                                     [ [ "", " " ],
41                                       [ "Allow", $text{'acl_allow'} ],
42                                       [ "Deny", $text{'acl_deny'} ] ]).
43                   "</td>\n";
44         $table .= "<td>".&ui_opt_textbox("src_$i",
45                                          $a->{'words'}->[1] eq "*" ? "" :
46                                                 $a->{'words'}->[1],
47                                          20, $text{'acl_any'})."</td>\n";
48         $table .= "<td>".&ui_opt_textbox("dest_$i",
49                                          $a->{'words'}->[3] eq "*" ? "" :
50                                                 $a->{'words'}->[3],
51                                          20, $text{'acl_any'})."</td>\n";
52         $table .= "<td>".&ui_opt_textbox("ports_$i",
53                                          $a->{'words'}->[4] eq "*" ? "" :
54                                                 $a->{'words'}->[4],
55                                          10, $text{'acl_any'})."</td>\n";
56         $table .= "</tr>\n";
57         $i++;
58         }
59 $table .= "</table>\n";
60 print &ui_table_row(undef, $table, 4);
61
62 print &ui_table_end();
63 print &ui_form_end([ [ 'save', $text{'save'} ] ], "100%");
64
65 &ui_print_footer("", $text{'index_return'});
66