Handle hostnames with upper-case letters
[webmin.git] / inetd / log_parser.pl
1 # log_parser.pl
2 # Functions for parsing this module's logs
3
4 do 'inetd-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 'apply') {
12         return $text{'log_apply'};
13         }
14 elsif ($type eq 'serv') {
15         local $msg = $p->{'prog'} ? "log_${action}_prog"
16                                   : "log_${action}_serv";
17         $msg .= "_l" if ($long);
18         return &text($msg, "<tt>$object</tt>", "<tt>$p->{'port'}</tt>",
19                      "<tt>".&html_escape($p->{'prog'})."</tt>");
20         }
21 elsif ($type eq 'rpc') {
22         local $msg = $p->{'prog'} ? "log_${action}_rprog"
23                                   : "log_${action}_rpc";
24         $msg .= "_l" if ($long);
25         return &text($msg, "<tt>$object</tt>", "<tt>$p->{'number'}</tt>",
26                      "<tt>".&html_escape($p->{'prog'})."</tt>");
27         }
28 else {
29         return undef;
30         }
31 }
32