Handle hostnames with upper-case letters
[webmin.git] / procmail / log_parser.pl
1 # log_parser.pl
2 # Functions for parsing this module's logs
3
4 do 'procmail-lib.pl';
5
6 # parse_webmin_log(user, script, action, type, object, &params)
7 # Converts logged information from this module into human-readable form
8 sub parse_webmin_log
9 {
10 local ($user, $script, $action, $type, $object, $p) = @_;
11 if ($type eq "recipe") {
12         local ($t, $a) = &parse_action($p);
13         return &text('log_'.$action.'_rec',
14                      &text('log_act'.$t, &html_escape($a)));
15         }
16 elsif ($type eq "env") {
17         return &text('log_'.$action.'_env', &html_escape($p->{'name'}));
18         }
19 elsif ($type eq "inc") {
20         return &text('log_'.$action.'_inc', &html_escape($p->{'include'}));
21         }
22 elsif ($type eq "recipes") {
23         return &text('log_'.$action.'_recs', $object);
24         }
25 else {
26         return $text{'log_'.$action};
27         }
28 }
29