Handle hostnames with upper-case letters
[webmin.git] / ipfilter / log_parser.pl
1 # log_parser.pl
2 # Functions for parsing this module's logs
3
4 do 'ipfilter-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, $long) = @_;
11 if ($action eq "delsel") {
12         return &text($type eq "nat" ? 'log_delselnat'
13                                     : 'log_delsel', $p->{'count'});
14         }
15 elsif ($type eq "rule") {
16         return &text("log_${action}_rule".($long ? "_l" : ""),
17                      $text{'action_'.$p->{'action'}},
18                      &describe_rule($p, 1));
19         }
20 elsif ($type eq "nat") {
21         return &text("log_${action}_nat".($long ? "_l" : ""),
22                      $text{'action_'.$p->{'action'}},
23                      &describe_from($p, 1),
24                      &describe_to($p, 1));
25         }
26 elsif ($type eq "host" || $type eq "group") {
27         return &text("log_${action}_${type}", "<tt>$object</tt>");
28         }
29 else {
30         return $text{"log_$action"};
31         }
32 }
33