Handle hostnames with upper-case letters
[webmin.git] / lilo / log_parser.pl
1 # log_parser.pl
2 # Functions for parsing this module's logs
3
4 do 'lilo-lib.pl';
5 &foreign_require("mount", "mount-lib.pl");
6
7 # parse_webmin_log(user, script, action, type, object, &params)
8 # Converts logged information from this module into human-readable form
9 sub parse_webmin_log
10 {
11 local ($user, $script, $action, $type, $object, $p, $long) = @_;
12 local $ll = $long ? "_l" : "";
13 if ($type eq 'image') {
14         return &text("log_${action}_image${ll}", "<tt>$object</tt>",
15                      "<tt>".&html_escape($p->{'image'})."</tt>");
16         }
17 elsif ($type eq 'other') {
18         local $other = &foreign_call("mount", "device_name", $p->{'other'})
19                 if ($long);
20         return &text("log_${action}_other${ll}", "<tt>$object</tt>", $other);
21         }
22 elsif ($action eq 'apply') {
23         return $text{'log_apply'};
24         }
25 elsif ($action eq 'global') {
26         return $text{'log_global'};
27         }
28 else {
29         return undef;
30         }
31 }
32