Handle hostnames with upper-case letters
[webmin.git] / hpuxexports / log_parser.pl
1 # log_parser.pl
2 # Functions for parsing this module's logs
3
4 do 'exports-lib.pl';
5
6 # parse_webmin_log(user, script, action, type, object, &params, [long])
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 $p->{'host'} = $p->{'host'} ? &html_escape($p->{'host'}) : '*';
12 $object = &html_escape($object);
13 if ($action eq 'modify') {
14         return &text($long ? 'log_modify_l' : 'log_modify',
15                      "<tt>$object</tt>", "<tt>$p->{'host'}</tt>");
16         }
17 elsif ($action eq 'create') {
18         return &text($long ? 'log_create_l' : 'log_create',
19                      "<tt>$object</tt>", "<tt>$p->{'host'}</tt>");
20         }
21 elsif ($action eq 'delete') {
22         return &text($long ? 'log_delete_l' : 'log_delete',
23                      "<tt>$object</tt>", "<tt>$p->{'host'}</tt>");
24         }
25 elsif ($action eq 'apply') {
26         return $text{'log_apply'};
27         }
28 else {
29         return undef;
30         }
31 }
32