Handle hostnames with upper-case letters
[webmin.git] / bacula-backup / log_parser.pl
1 # log_parser.pl
2 # Functions for parsing this module's logs
3
4 do 'bacula-backup-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 ($type eq "client" || $type eq "fileset" || $type eq "schedule" ||
12     $type eq "job" || $type eq "pool" || $type eq "storage" ||
13     $type eq "device" || $type eq "group" || $type eq "gjob") {
14         # Adding, modifying or deleting some object
15         return &text('log_'.$action.'_'.$type,
16                      "<tt>".&html_escape($object)."</tt>");
17         }
18 elsif ($type eq "clients" || $type eq "filesets" || $type eq "schedules" ||
19     $type eq "jobs" || $type eq "pools" || $type eq "storages" ||
20     $type eq "devices" || $type eq "groups" || $type eq "gjobs") {
21         # Deleting several
22         return &text('log_'.$action.'_'.$type, $object);
23         }
24 else {
25         return &text('log_'.$action, "<tt>".&html_escape($object)."</tt>");
26         }
27 }
28