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