Handle hostnames with upper-case letters
[webmin.git] / xinetd / log_parser.pl
1 # log_parser.pl
2 # Functions for parsing this module's logs
3
4 do 'xinetd-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 ($type eq 'serv') {
12         return &text("log_${action}_serv",
13                      "<tt>".&html_escape($object)."</tt>",
14                      uc($p->{'protocol'}));
15         }
16 elsif ($action eq "enable" || $action eq "disable") {
17         if ($long && $p->{'servs'}) {
18                 return &text('log_'.$action.'_l',
19                      join(", ", map { "<tt>$_</tt>" } split(/\0/, $p->{'servs'})));
20                 }
21         else {
22                 return &text('log_'.$action, $object);
23                 }
24         }
25 else {
26         return $text{'log_'.$action};
27         }
28 }
29