Handle hostnames with upper-case letters
[webmin.git] / wuftpd / edit_log.cgi
1 #!/usr/local/bin/perl
2 # edit_log.cgi
3 # Display logging options
4
5 require './wuftpd-lib.pl';
6 &ui_print_header(undef, $text{'log_title'}, "", "log");
7
8 $conf = &get_ftpaccess();
9 foreach $l (&find_value('log', $conf)) {
10         $log{$l->[0]} = $l;
11         }
12
13 print "<form action=save_log.cgi>\n";
14 print "<table border>\n";
15 print "<tr $tb> <td><b>$text{'log_header'}</b></td> </tr>\n";
16 print "<tr $cb> <td><table width=100%>\n";
17
18 # Display log commands option
19 map { $commands{$_}++ } split(/,/, $log{'commands'}->[1]);
20 print "<tr> <td><b>$text{'log_commands'}</b></td> <td>\n";
21 foreach $c ('anonymous', 'guest', 'real') {
22         printf "<input type=checkbox name=commands value=$c %s> %s\n",
23                 $commands{$c} ? 'checked' : '', $text{"log_$c"};
24         }
25 print "</td> </tr>\n";
26
27 # Display log transfers option
28 map { $transfers{$_}++ } split(/,/, $log{'transfers'}->[1]);
29 print "<tr> <td valign=top><b>$text{'log_trans'}</b></td> <td>\n";
30 foreach $c ('anonymous', 'guest', 'real') {
31         printf "<input type=checkbox name=transfers value=$c %s> %s\n",
32                 $transfers{$c} ? 'checked' : '', $text{"log_$c"};
33         }
34 print "</td> </tr> <tr> <td></td> <td>\n";
35 print "<b>$text{'log_dir'}</b>\n";
36 $d = $log{'transfers'}->[2];
37 printf "<input type=radio name=direction value=inbound %s> %s\n",
38         $d eq 'inbound' ? 'checked' : '', $text{'log_inbound'};
39 printf "<input type=radio name=direction value=outbound %s> %s\n",
40         $d eq 'outbound' ? 'checked' : '', $text{'log_outbound'};
41 printf "<input type=radio name=direction value=inbound,outbound %s> %s\n",
42         $d =~ /inbound/ && $d =~ /outbound/ ? 'checked' : '', $text{'log_both'};
43 print "</td> </tr>\n";
44
45 # Display log syslog option
46 print "<tr> <td><b>$text{'log_to'}</b></td> <td>\n";
47 printf "<input type=radio name=syslog value=1 %s> %s\n",
48         $log{'syslog'} ? 'checked' : '', $text{'log_syslog'};
49 printf "<input type=radio name=syslog value=0 %s> %s\n",
50         $log{'syslog'} || $log{'syslog+xferlog'} ? '' : 'checked',
51         $text{'log_xferlog'};
52 printf "<input type=radio name=syslog value=2 %s> %s</td> </tr>\n",
53         $log{'syslog+xferlog'} ? 'checked' : '', $text{'log_sysxfer'};
54
55 # Display log security option
56 map { $security{$_}++ } split(/,/, $log{'security'}->[1]);
57 print "<tr> <td><b>$text{'log_security'}</b></td> <td>\n";
58 foreach $c ('anonymous', 'guest', 'real') {
59         printf "<input type=checkbox name=security value=$c %s> %s\n",
60                 $security{$c} ? 'checked' : '', $text{"log_$c"};
61         }
62 print "</td> </tr>\n";
63
64 print "</table></td></tr></table>\n";
65 print "<input type=submit value=\"$text{'save'}\"></form>\n";
66
67 &ui_print_footer("", $text{'index_return'});
68