Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r288 r289 2535 2535 my $msg = $@; 2536 2536 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 } 2537 2543 return ('FAIL',$msg); 2538 2544 } … … 2665 2671 my $msg = $@; 2666 2672 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 } 2667 2679 return ('FAIL', $msg); 2668 2680 } -
trunk/dns.cgi
r288 r289 691 691 $page->param(id => $webvar{id}); 692 692 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 }703 693 } 704 694 … … 725 715 changepage(page => "reclist", errmsg => "You are not permitted to edit records", id => $webvar{parentid}) 726 716 unless ($permissions{admin} || $permissions{record_edit}); 727 728 # # prevent out-of-domain records from getting added by appending the domain, or DOMAIN for default records729 # my $pname = ($webvar{defrec} eq 'y' ? 'DOMAIN' : domainName($dbh,$webvar{parentid}));730 # $webvar{name} =~ s/\.*$/\.$pname/ if $webvar{name} !~ /$pname$/;731 717 732 718 # get current/previous record info so we can log "updated 'foo A 1.2.3.4' to 'foo A 2.3.4.5'" … … 752 738 $page->param(id => $webvar{id}); 753 739 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 }764 740 } 765 741 }
Note:
See TracChangeset
for help on using the changeset viewer.