Handle hostnames with upper-case letters
[webmin.git] / pap / log_parser.pl
1 # log_parser.pl
2 # Functions for parsing this module's logs
3
4 do 'pap-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 'mgetty') {
12         return &text('log_mgetty_'.$action,
13                      "<tt>".&html_escape($object)."</tt>");
14         }
15 elsif ($type eq 'dialin') {
16         return &text('log_dialin_'.$action,
17                      "<tt>".&html_escape($object)."</tt>");
18         }
19 elsif ($action eq 'options') {
20         return $object ne '-' ?
21                 &text('log_options2', "<tt>".&html_escape($object)."</tt>") :
22                 $text{'log_options'};
23         }
24 elsif ($action eq 'sync') {
25         return $text{'log_sync'};
26         }
27 elsif ($action eq 'mgetty_apply') {
28         return $text{'log_apply'};
29         }
30 elsif ($action eq 'deletes') {
31         return &text('log_deletes', $object);
32         }
33 else {
34         return &text('log_'.$action, "<tt>".&html_escape($object)."</tt>");
35         }
36 }
37