Handle hostnames with upper-case letters
[webmin.git] / dhcpd / log_parser.pl
1 # log_parser.pl
2 # Functions for parsing this module's logs
3
4 do 'dhcpd-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 'apply') {
12         return $text{'log_apply'};
13         }
14 elsif ($action eq 'start') {
15         return $text{'log_start'};
16         }
17 elsif ($action eq 'stop') {
18         return $text{'log_stop'};
19         }
20 elsif ($type eq 'subnet' || $type eq 'shared' || $type eq 'host') {
21         return &text("log_${action}_${type}",
22                      "<tt>".&html_escape($object)."</tt>");
23         }
24 elsif ($type eq 'group') {
25         local @h = split(/,/, $object);
26         return &text("log_${action}_group", scalar(@h));
27         }
28 elsif ($type eq 'subnets' || $type eq 'hosts') {
29         return &text("log_${action}_${type}", $object);
30         }
31 elsif ($type eq 'lease' && $action eq 'delete') {
32         return &text('log_delete_lease',
33                      "<tt>".&html_escape($object)."</tt>");
34         }
35 else {
36         return undef;
37         }
38 }
39