mirror of
https://github.com/webmin/webmin.git
synced 2026-06-05 04:40:24 +01:00
Adds a Webmin GRUB 2 module for inspecting boot entries, editing defaults, custom entries, themes, password protection, BLS-aware kernel options, safe menu regeneration, boot loader installation, manual config editing, status reporting, ACLs, backups, logging, and tests.
69 lines
1.7 KiB
Perl
69 lines
1.7 KiB
Perl
# log_parser.pl
|
|
# Functions for parsing this module's logs.
|
|
|
|
use strict;
|
|
use warnings;
|
|
do 'grub2-lib.pl';
|
|
|
|
our %text;
|
|
|
|
# parse_webmin_log(user, script, action, type, object, ¶ms, [long])
|
|
# Converts logged information from this module into human-readable form.
|
|
sub parse_webmin_log
|
|
{
|
|
my ($user, $script, $action, $type, $object, $p, $long) = @_;
|
|
# Simple module-wide actions do not need an object value.
|
|
if ($action eq 'defaults') {
|
|
return $text{'log_defaults'};
|
|
}
|
|
if ($action eq 'bls_args') {
|
|
return $text{'log_bls_args'};
|
|
}
|
|
if ($action eq 'theme') {
|
|
return $text{'log_theme'};
|
|
}
|
|
if ($action eq 'security') {
|
|
return $text{'log_security'};
|
|
}
|
|
# Object-bearing actions display paths, selectors, or titles as literals.
|
|
if ($action eq 'manual') {
|
|
return &text('log_manual', &log_value($object));
|
|
}
|
|
if ($action eq 'custom_create') {
|
|
return &text('log_custom_create', &log_value($object));
|
|
}
|
|
if ($action eq 'custom_modify') {
|
|
return &text('log_custom_modify', &log_value($object));
|
|
}
|
|
if ($action eq 'custom_move') {
|
|
return &text('log_custom_move', &log_value($object));
|
|
}
|
|
if ($action eq 'generate') {
|
|
return &text('log_generate', &log_value($object));
|
|
}
|
|
if ($action eq 'install') {
|
|
return &text('log_install', &log_value($object));
|
|
}
|
|
if ($action eq 'default') {
|
|
return &text('log_default', &log_value($object));
|
|
}
|
|
if ($action eq 'once') {
|
|
return &text('log_once', &log_value($object));
|
|
}
|
|
if ($action eq 'custom_delete') {
|
|
return &text('log_custom_delete', $object || 0);
|
|
}
|
|
return;
|
|
}
|
|
|
|
# log_value(value)
|
|
# Returns a styled inline value for log descriptions.
|
|
sub log_value
|
|
{
|
|
my ($value) = @_;
|
|
$value = '' if (!defined($value));
|
|
return &ui_tag('tt', &html_escape($value));
|
|
}
|
|
|
|
1;
|