Handle hostnames with upper-case letters
[webmin.git] / exports-nfs4 / 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 ($type eq 'exports') {
14         return &text('log_'.$action.'_exports', $object);
15         }
16 elsif ($action eq 'modify') {
17         return &text($long ? 'log_modify_l' : 'log_modify',
18                      "<tt>$object</tt>", "<tt>$p->{'host'}</tt>");
19         }
20 elsif ($action eq 'create') {
21         return &text($long ? 'log_create_l' : 'log_create',
22                      "<tt>$object</tt>", "<tt>$p->{'host'}</tt>");
23         }
24 elsif ($action eq 'delete') {
25         return &text($long ? 'log_delete_l' : 'log_delete',
26                      "<tt>$object</tt>", "<tt>$p->{'host'}</tt>");
27         }
28 elsif ($action eq 'apply') {
29         return $text{'log_apply'};
30         }
31 else {
32         return undef;
33         }
34 }
35