Handle hostnames with upper-case letters
[webmin.git] / majordomo / log_parser.pl
1 # log_parser.pl
2 # Functions for parsing this module's logs
3
4 do 'majordomo-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 $object = &html_escape($object);
12 $p->{'addr'} = &html_escape($p->{'addr'});
13 if ($action eq 'global') {
14         return $text{'log_global'};
15         }
16 elsif ($action eq 'create') {
17         return &text("log_create_${type}", "<tt>$object</tt>");
18         }
19 elsif ($action eq 'delete') {
20         return &text("log_delete_${type}", "<tt>$object</tt>");
21         }
22 elsif ($action eq 'subscribe') {
23         return &text('log_subscribe', "<tt>$object</tt>",
24                                       "<tt>$p->{'addr'}</tt>");
25         }
26 elsif ($action eq 'unsubscribe') {
27         return &text('log_unsubscribe', "<tt>$object</tt>",
28                                         "<tt>$p->{'addr'}</tt>");
29         }
30 elsif ($text{"log_${action}"}) {
31         return &text("log_${action}", "<tt>$object</tt>");
32         }
33 else {
34         return undef;
35         }
36 }
37