2 # Functions for parsing this module's logs
6 # parse_webmin_log(user, script, action, type, object, ¶ms, long)
7 # Converts logged information from this module into human-readable form
10 local ($user, $script, $action, $type, $object, $p, $long) = @_;
11 if ($type eq 'alias') {
12 return &text("log_alias_$action",
13 "<tt>".&html_escape($object)."</tt>");
15 elsif ($type eq 'virt') {
16 return &text($object ne '-' ? "log_virt_$action" :
17 "log_virtall_$action", "<tt>".&html_escape($object)."</tt>");
19 elsif ($type eq 'route') {
20 return &text("log_route_$action",
21 "<tt>".&html_escape($object)."</tt>");
23 elsif ($type eq 'assign') {
24 local $str = $object =~ /^=(\S*)/ ? $1 :
25 $object =~ /^\+(\S*)/ ? "$1*" : "";
26 return &text("log_assign_$action", &html_escape($str));
28 elsif ($type eq 'aliases' || $type eq 'virts' || $type eq 'routes' ||
30 return &text("log_${action}_${type}", $object);
32 elsif ($action eq 'delmail') {
33 local @d = split(/\0/, $p->{'d'});
34 return &text("log_delmail", scalar(@d), "<tt>$p->{'user'}</tt>");
36 elsif ($action eq 'movemail') {
37 local @d = split(/\0/, $p->{'d'});
38 local $to = $p->{'move1'} ? $p->{'moveto1'} : $p->{'moveto2'};
39 return &text("log_movemail", scalar(@d), "<tt>$p->{'user'}</tt>",
42 elsif ($action eq 'send') {
43 return &text('log_send', &html_escape(&extract_email($p->{'to'})));
46 return $text{"log_$action"};