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 "restrict") {
12 return &text("log_restrict_$action",
13 $object eq "*" ? $text{'log_all'} :
14 $object =~ /^\@(.*)$/ ? &text('log_group', "<tt>$1</tt>")
15 : "<tt>$object</tt>");
17 elsif ($action eq 'install') {
18 return &text('log_install', "<i>$p->{'desc'}</i>");
20 elsif ($action eq 'tinstall') {
21 return &text('log_tinstall', "<i>$p->{'desc'}</i>");
23 elsif ($action eq 'clone') {
24 return &text('log_clone', "<i>$p->{'desc'}</i>",
25 "<i>$p->{'dstdesc'}</i>");
27 elsif ($action eq 'delete') {
28 return &text('log_delete', "<i>$p->{'desc'}</i>");
30 elsif ($action eq 'upgrade') {
31 return &text('log_upgrade', $p->{'version'});
33 elsif ($action eq 'uinstall') {
34 return &text('log_uinstall', $p->{'version'});
36 elsif ($action eq 'theme') {
37 return $p->{'theme'} ? &text('log_theme', "<tt>$p->{'theme'}</tt>")
38 : $text{'log_theme_def'};
40 elsif ($action eq "config") {
41 return &text('log_config', "<tt>$p->{'mod'}</tt>");
43 elsif ($action eq "uconfig") {
44 return &text('log_uconfig', "<tt>$p->{'mod'}</tt>");
46 elsif ($action eq 'switch') {
47 return &text('log_switch', "<tt>$object</tt>");
49 elsif ($text{"log_$action"}) {
50 return $text{"log_$action"};