# log_parser.pl # Functions for parsing this module's logs use strict; use warnings; do 'nginx-lib.pl'; our (%text); # parse_webmin_log(user, script, action, type, object, ¶ms) # Converts logged information from this module into human-readable form sub parse_webmin_log { my ($user, $script, $action, $type, $object, $p) = @_; if ($type eq 'mime') { return &text('log_'.$action.'_mime', "".&html_escape($object).""); } elsif ($type eq 'mimes') { return &text('log_'.$action.'_mimes', $object); } elsif ($action eq 'manual') { return &text('log_manual', "".&html_escape($object).""); } elsif ($type eq 'server') { return &text('log_'.$action.'_server', "".&html_escape($object).""); } elsif ($type eq 'location') { return &text('log_'.$action.'_location', "".&html_escape($object)."", "".&html_escape($p->{'server'}).""); } elsif ($type eq 'user') { return &text('log_'.$action.'_user', "".&html_escape($object)."", "".&html_escape($p->{'file'}).""); } else { return $text{'log_'.$action}; } return undef; }