Handle hostnames with upper-case letters
[webmin.git] / ipsec / log_parser.pl
1 # log_parser.pl
2 # Functions for parsing this module's logs
3
4 do 'ipsec-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 "conn") {
12         return &text('log_'.$action.'_conn', "<tt>$object</tt>");
13         }
14 elsif ($type eq "secret") {
15         if ($p->{'name'}) {
16                 return &text('log_'.$action.'_secret', "<tt>$p->{'name'}</tt>");
17                 }
18         else {
19                 return &text('log_'.$action.'_secret_nn');
20                 }
21         }
22 elsif ($action eq "up") {
23         return &text('log_up', "<tt>$object</tt>");
24         }
25 elsif ($action eq "policy") {
26         return &text('log_policy', $text{'policy_desc_'.$object} ||
27                                    &text('policy_desc', $object));
28         }
29 else {
30         return $text{'log_'.$action};
31         }
32 }
33