Handle hostnames with upper-case letters
[webmin.git] / pptp-client / log_parser.pl
1 # log_parser.pl
2 # Functions for parsing this module's logs
3
4 do 'pptp-client-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 $object = "<tt>". &html_escape($object)."</tt>";
12 if ($type eq 'tunnel') {
13         return &text('log_'.$action, $object);
14         }
15 elsif ($action eq 'conn') {
16         if ($p->{'address'}) {
17                 return &text($long ? 'log_conn_l' : 'log_conn',
18                              $object, $p->{'address'});
19                 }
20         else {
21                 return &text('log_failed', $object);
22                 }
23         }
24 elsif ($action eq 'disc') {
25         return &text('log_disc', $object);
26         }
27 else {
28         return $text{'log_'.$action};
29         }
30 }
31