Handle hostnames with upper-case letters
[webmin.git] / sarg / edit_sched.cgi
1 #!/usr/local/bin/perl
2 # Show schedule form
3
4 require './sarg-lib.pl';
5 &foreign_require("cron", "cron-lib.pl");
6 @jobs = &cron::list_cron_jobs();
7 ($job) = grep { $_->{'user'} eq 'root' &&
8                 $_->{'command'} eq $cron_cmd } @jobs;
9
10 $conf = &get_config();
11 $odir = &find_value("output_dir", $conf);
12 $sfile = &find_value("access_log", $conf);
13 &ui_print_header(undef, $text{'sched_title'}, "");
14
15 if (!$odir) {
16         &ui_print_endpage(&text('sched_edir', "edit_log.cgi"));
17         }
18 elsif (!$sfile) {
19         &ui_print_endpage(&text('sched_esfile', "edit_log.cgi"));
20         }
21
22 print &ui_form_start("save_sched.cgi", "post");
23 print &ui_table_start($text{'sched_header'}, "width=100%", 4);
24
25 print &ui_table_row($text{'sched_sched'},
26                     &ui_radio("sched", $job ? 1 : 0,
27                               [ [ 0, $text{'no'} ],
28                                 [ 1, $text{'sched_yes'} ] ]), 3);
29
30 print &ui_table_row($text{'sched_dir'},
31                     "<tt>$odir</tt>", 3);
32
33 print &ui_table_row($text{'sched_clear'}, &gen_clear_input(), 3);
34
35 print &ui_table_row($text{'sched_range'}, &gen_range_input(), 3);
36
37 print "<tr> <td colspan=4><table border width=100%>\n";
38 &cron::show_times_input($job || { 'special' => 'daily' });
39 print "</table></td></tr>\n";
40
41 print &ui_table_end();
42 print &ui_form_end([ [ 'save', $text{'save'} ] ], "100%");
43 &ui_print_footer("", $text{'index_return'});
44