Changeset 289


Ignore:
Timestamp:
03/27/12 12:56:12 (13 years ago)
Author:
Kris Deugau
Message:

/trunk

Forgot to move failed-action logging for addRec() and
updateRec(), done.
Removed commented domain-name-canonicalization for record-update page
See #35

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r288 r289  
    25352535    my $msg = $@;
    25362536    eval { $dbh->rollback; };
     2537    if ($config{log_failures}) {
     2538      $logdata{entry} = "Failed adding ".($defrec eq 'y' ? 'default ' : '').
     2539        "record '$$host $typemap{$$rectype} $$val', TTL $ttl ($msg)";
     2540      _log($dbh, %logdata);
     2541      $dbh->commit;
     2542    }
    25372543    return ('FAIL',$msg);
    25382544  }
     
    26652671    my $msg = $@;
    26662672    eval { $dbh->rollback; };
     2673    if ($config{log_failures}) {
     2674      $logdata{entry} = "Failed updating ".($defrec eq 'y' ? 'default ' : '').
     2675        "record '$oldrec->{host} $typemap{$oldrec->{type}} $oldrec->{val}', TTL $oldrec->{ttl} ($msg)";
     2676      _log($dbh, %logdata);
     2677      $dbh->commit;
     2678    }
    26672679    return ('FAIL', $msg);
    26682680  }
  • trunk/dns.cgi

    r288 r289  
    691691      $page->param(id           => $webvar{id});
    692692      fill_recdata();   # populate the form... er, mostly.
    693       if ($config{log_failures}) {
    694         if ($webvar{defrec} eq 'y') {
    695           logaction(0, $session->param("username"), $webvar{parentid},
    696                 "Failed adding default record '$webvar{name} $typemap{$webvar{type}} $webvar{address}', TTL $webvar{ttl} ($msg)");
    697         } else {
    698           logaction($webvar{parentid}, $session->param("username"),
    699                 parentID($dbh, (id => $webvar{parentid}, type => 'domain', revrec => $webvar{revrec})),
    700                 "Failed adding record '$webvar{name} $typemap{$webvar{type}} $webvar{address}', TTL $webvar{ttl} ($msg)");
    701         }
    702       }
    703693    }
    704694
     
    725715    changepage(page => "reclist", errmsg => "You are not permitted to edit records", id => $webvar{parentid})
    726716        unless ($permissions{admin} || $permissions{record_edit});
    727 
    728 #    # prevent out-of-domain records from getting added by appending the domain, or DOMAIN for default records
    729 #    my $pname = ($webvar{defrec} eq 'y' ? 'DOMAIN' : domainName($dbh,$webvar{parentid}));
    730 #    $webvar{name} =~ s/\.*$/\.$pname/ if $webvar{name} !~ /$pname$/;
    731717
    732718    # get current/previous record info so we can log "updated 'foo A 1.2.3.4' to 'foo A 2.3.4.5'"
     
    752738      $page->param(id           => $webvar{id});
    753739      fill_recdata();
    754       if ($config{log_failures}) {
    755         if ($webvar{defrec} eq 'y') {
    756           logaction(0, $session->param("username"), $webvar{parentid},
    757                 "Failed updating default record '$typemap{$webvar{type}} $webvar{name} $webvar{address}', TTL $webvar{ttl} ($msg)");
    758         } else {
    759           logaction($webvar{parentid}, $session->param("username"),
    760                 parentID($dbh, (id => $webvar{parentid}, type => 'domain', revrec => $webvar{revrec})),
    761                 "Failed updating record '$typemap{$webvar{type}} $webvar{name} $webvar{address}', TTL $webvar{ttl} ($msg)");
    762         }
    763       }
    764740    }
    765741  }
Note: See TracChangeset for help on using the changeset viewer.