Handle hostnames with upper-case letters
[webmin.git] / lpadmin / log_parser.pl
1 # log_parser.pl
2 # Functions for parsing this module's logs
3
4 do 'lpadmin-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, $long) = @_;
11 if ($action eq 'cancel') {
12         return &text("log_cancel_${type}",
13                      "<tt>".&html_escape($object)."</tt>",
14                      "<tt>".&html_escape($p->{'id'})."</tt>");
15         }
16 elsif ($action eq 'cancelsel') {
17         return &text("log_cancel_sel", "<tt>".&html_escape($object)."</tt>",
18                      $p->{'d'});
19         }
20 elsif ($action eq 'stop') {
21         return $text{'log_stop'};
22         }
23 elsif ($action eq 'start') {
24         return $text{'log_start'};
25         }
26 elsif ($action eq 'restart') {
27         return $text{'log_restart'};
28         }
29 elsif ($type eq 'printer') {
30         return &text($long && $p->{'mode'} ? "log_${action}_l" : "log_$action",
31                      "<tt>$object</tt>",
32                      "<tt>".&html_escape($p->{'dest'})."</tt>",
33                      &html_escape($p->{'driver'}));
34         }
35 else {
36         return undef;
37         }
38 }
39