Handle hostnames with upper-case letters
[webmin.git] / time / log_parser.pl
1 # log_parser.pl
2 # Functions for parsing this module's logs
3
4 do 'time-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 'remote') {
12         local $tm = localtime($object);
13         return &text($long ? "log_remote_${type}_l" : "log_remote_${type}",
14              "<i>$tm</i>", "<tt>".&html_escape($p->{'timeserver'})."</tt>");
15         }
16 elsif ($action eq 'set') {
17         local $tm = localtime($object);
18         return &text("log_set_${type}", "<i>$tm</i>");
19         }
20 elsif ($action eq 'sync') {
21         return $text{'log_sync'};
22         }
23 elsif ($action eq 'sync_s') {
24         return $text{'log_sync_s'};
25         }
26 elsif ($action eq 'timezone') {
27         return &text('log_timezone', &html_escape($object));
28         }
29 else {
30         return undef;
31         }
32 }
33