Handle hostnames with upper-case letters
[webmin.git] / cron / edit_allow.cgi
1 #!/usr/local/bin/perl
2 # edit_allow.cgi
3 # A form for editing the system cron.allow and cron.deny files
4
5 require './cron-lib.pl';
6 $access{'allow'} || &error($text{'allow_ecannot'});
7 &ui_print_header(undef, $text{'allow_title'}, "");
8
9 print &ui_form_start("save_allow.cgi");
10 print "$text{'allow_desc'} <p>\n";
11
12 $allowfile = (-r $config{cron_allow_file});
13 $denyfile = (-r $config{cron_deny_file});
14 $nofile = $config{cron_deny_all};
15 $mode = !$allowfile && !$denyfile ? 0 :
16         $allowfile ? 1 : 2;
17 print &ui_radio_table("mode", $mode,
18         [ [ 0, $nofile==0 ? $text{'allow_all1'} :
19                $nofile==1 ? $text{'allow_all2'} :
20                             $text{'allow_all3'} ],
21           [ 1, $text{'allow_allow'},
22                 &ui_textbox("allow",
23                   $allowfile ? join(' ', &list_allowed()) : "", 50).
24                 " ".&user_chooser_button("allow", 1) ],
25           [ 2, $text{'allow_deny'},
26                 &ui_textbox("deny",
27                   $denyfile ? join(' ', &list_denied()) : "", 50).
28                 " ".&user_chooser_button("deny", 1) ] ]);
29 print &ui_form_end([ [ undef, $text{'save'} ] ]);
30
31 &ui_print_footer("", $text{'index_return'});
32