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 'record') {
12 if ($p->{'type'} eq 'PTR') {
13 return &text("log_${action}_record", $text{"type_$p->{'type'}"},
14 "<tt>".&arpa_to_ip($p->{'name'})."</tt>",
15 "<tt>".&arpa_to_ip($object)."</tt>");
18 $p->{'name'} =~ s/\.$object\.*$//;
19 if (($action eq "modify" || $action eq "create") &&
21 return &text("log_${action}_record_v",
22 $text{"type_$p->{'type'}"},
23 "<tt>$p->{'name'}</tt>",
25 "<tt>$p->{'newvalues'}</tt>");
28 return &text("log_${action}_record",
29 $text{"type_$p->{'type'}"},
30 "<tt>$p->{'name'}</tt>",
35 elsif ($type eq 'recs') {
36 return &text("log_${action}_recs", $object);
38 elsif ($type eq 'zones') {
39 return &text("log_${action}_zones", $object);
41 elsif ($type eq "host" || $type eq "group") {
42 return &text("log_${action}_${type}", "<tt>$object</tt>");
44 elsif ($action eq 'create') {
45 return &text("log_${type}", "<tt>$object</tt>");
47 elsif ($action eq 'delete') {
48 return &text("log_delete_${type}", "<tt>$object</tt>");
50 elsif ($action eq 'text') {
51 return &text("log_text", "<tt>$object</tt>");
53 elsif ($action eq 'soa') {
54 return &text("log_soa", "<tt>$object</tt>");
56 elsif ($action eq 'zonekeyon' || $action eq 'zonekeyoff' || $action eq 'sign') {
57 return &text("log_".$action, "<tt>$object</tt>");
59 elsif ($action eq 'opts') {
60 return &text("log_opts", "<tt>$object</tt>");
62 elsif ($action eq 'view') {
63 return &text("log_review", "<tt>$object</tt>");
65 elsif ($action eq 'move') {
66 return &text("log_move", "<tt>$object</tt>");
68 elsif ($action eq 'apply' && $type && $type ne '-') {
69 return &text("log_apply2", "<tt>$type</tt>");
71 elsif ($action eq 'freeze' || $action eq 'thaw') {
72 return &text("log_".$action, "<tt>$type</tt>");
74 elsif ($action eq 'mass') {
75 return &text("log_mass", $object);
77 elsif ($action eq 'manual') {
78 return &text("log_manual", "<tt>$object</tt>");
80 elsif ($text{"log_${action}"}) {
81 return $text{"log_${action}"};