Handle hostnames with upper-case letters
[webmin.git] / inittab / log_parser.pl
1 # log_parser.pl
2 # Functions for parsing this module's logs
3
4 do 'inittab-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 ($action eq 'modify' && $p->{'oldid'} ne $object) {
12         return &text('log_modify', "<tt>$p->{'oldid'}</tt>",
13                                    "<tt>$object</tt>");
14         }
15 elsif ($action eq 'modify') {
16         return &text('log_modify', "<tt>$object</tt>");
17         }
18 elsif ($action eq 'create') {
19         return &text('log_create', "<tt>$object</tt>");
20         }
21 elsif ($action eq 'delete') {
22         if ($type eq 'inittabs') {
23                 return &text('log_deletes', "<tt>$object</tt>");
24                 }
25         else {
26                 return &text('log_delete', "<tt>$object</tt>");
27                 }
28         }
29 elsif ($action eq 'apply') {
30         return $text{'log_apply'};
31         }
32 else {
33         return undef;
34         }
35 }
36