2 # Functions for parsing this module's logs
6 # parse_webmin_log(user, script, action, type, object, ¶ms)
7 # Converts logged information from this module into human-readable form
10 local ($user, $script, $action, $type, $object, $p) = @_;
11 if ($type eq "rule") {
12 local $source = &group_names($p->{'source'});
13 local $dest = &group_names($p->{'dest'});
14 return &text('log_'.$action.'_'.$type, $source, $dest);
16 elsif ($type eq "service" || $type eq "group" || $type eq "user" ||
17 $type eq "time" || $type eq "sep") {
18 return &text('log_'.$action.'_'.$type,
19 "<tt>".&html_escape($object)."</tt>");
21 elsif ($type eq "nat" || $type eq "pat" || $type eq "spoof") {
22 return $text{'log_'.$action.'_'.$type};
24 elsif ($action eq "backup" || $action eq "restore") {
25 return $object ? &text('log_'.$action, "<tt>".&html_escape($object)."</tt>") : $text{'log_'.$action.'_file'};
27 elsif ($action eq "import") {
28 return $text{'log_import_'.$type};
30 elsif ($type eq "rules") {
31 if (defined($p->{'enabled'})) {
32 return &text('log_oldenable_rules',
33 $p->{'enabled'}, $p->{'disabled'});
36 return &text('log_'.$action.'_rules', $p->{'count'});
40 return $text{'log_'.$action};