2 # Functions for parsing this module's logs
4 do 'ldap-server-lib.pl';
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, $long) = @_;
13 $object =~ s/,\s+/,/g;
14 return &text('log_'.$action.'_dn',
15 "<tt>".&html_escape($object)."</tt>");
17 elsif ($type eq 'dns') {
19 return &text('log_'.$action.'_dns', $object);
21 elsif ($type eq 'attr') {
22 # Changed some attribute of a DN
23 $p->{'dn'} =~ s/,\s+/,/g;
24 return &text($long ? 'log_'.$action.'_attr_l' : 'log_'.$action.'_attr',
25 "<tt>".&html_escape($object)."</tt>",
26 "<tt>".&html_escape($p->{'dn'})."</tt>",
27 "<tt>".&html_escape($p->{'value'})."</tt>");
29 elsif ($type eq 'attrs') {
30 # Multi-attribute operation
31 $p->{'dn'} =~ s/,\s+/,/g;
32 return &text('log_'.$action.'_attrs', $object,
33 "<tt>".&html_escape($p->{'dn'})."</tt>");
35 elsif ($type eq 'access') {
36 return &text('log_'.$action.'_access',
37 $object eq '*' ? $text{'log_all'} :
38 $object =~ /^dn(\.[^=]+)?=(.*)/ ?
39 "<tt>".&html_escape("$2")."</tt>" :
40 "<tt>".&html_escape($object)."</tt>");
42 elsif ($type eq 'accesses') {
43 return &text('log_'.$action.'_accesses', $object);
45 elsif ($action eq 'sfile' || $action eq 'sup' || $action eq 'sdown') {
46 return &text('log_'.$action, "<tt>".&html_escape($object)."</tt>");
48 elsif ($action eq 'boot') {
49 return $object ? $text{'log_bootup'} : $text{'log_bootdown'};
51 elsif ($action eq 'create') {
52 return &text('log_create', "<tt>".&html_escape($object)."</tt>");
55 return $text{'log_'.$action};