<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># log_parser.pl
# Functions for parsing this module's logs

do 'samba-lib.pl';

# parse_webmin_log(user, script, action, type, object, &amp;params)
# Converts logged information from this module into human-readable form
sub parse_webmin_log
{
local ($user, $script, $action, $type, $object, $p, $long) = @_;
$object = &amp;html_escape($object);
if ($type eq 'shares') {
	return &amp;text("log_delete_${type}", $object);
	}
elsif ($action eq 'save') {
	if ($object eq 'global') {
		return $text{"log_default_${type}"};
		}
	else {
		return &amp;text("log_save_${type}", "&lt;tt&gt;$object&lt;/tt&gt;");
		}
	}
elsif ($action eq 'create') {
	return &amp;text("log_create_${type}", "&lt;tt&gt;$object&lt;/tt&gt;");
	}
elsif ($action eq 'delete') {
	return &amp;text("log_delete_${type}", "&lt;tt&gt;$object&lt;/tt&gt;");
	}
elsif ($action eq 'manual') {
	return &amp;text("log_manual", "&lt;tt&gt;$object&lt;/tt&gt;");
	}
elsif ($action eq 'copy') {
	return &amp;text('log_copy', "&lt;tt&gt;$object&lt;/tt&gt;",
		     "&lt;tt&gt;".&amp;html_escape($p-&gt;{'copy'})."&lt;/tt&gt;");
	}
elsif ($action eq 'epass') {
	return &amp;text($long ? 'log_epass_l' : 'log_epass',
		     int($p-&gt;{'created'}), int($p-&gt;{'modified'}),
		     int($p-&gt;{'deleted'}));
	}
elsif ($type eq 'euser') {
	return &amp;text("log_${action}_euser", "&lt;tt&gt;$object&lt;/tt&gt;");
	}
elsif ($type eq 'group') {
	return &amp;text("log_${action}_group", "&lt;tt&gt;$object&lt;/tt&gt;");
	}
elsif ($action eq 'kill') {
	if ($p-&gt;{'share'}) {
		return &amp;text('log_skill', "&lt;tt&gt;$object&lt;/tt&gt;",
			     "&lt;tt&gt;".&amp;html_escape($p-&gt;{'share'})."&lt;/tt&gt;");
		}
	else {
		return &amp;text('log_kill', "&lt;tt&gt;$object&lt;/tt&gt;");
		}
	}
elsif ($action eq 'kills') {
	if ($p-&gt;{'share'}) {
		return &amp;text('log_skills', $object,
			     "&lt;tt&gt;".&amp;html_escape($p-&gt;{'share'})."&lt;/tt&gt;");
		}
	else {
		return &amp;text('log_kills', $object);
		}
	}
elsif ($text{"log_${action}"}) {
	return $text{"log_${action}"};
	}
else {
	return undef;
	}
}

</pre></body></html>