Changeset 659 for trunk/dns-rpc.cgi
- Timestamp:
- 09/12/14 18:00:03 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns-rpc.cgi
r543 r659 83 83 'dnsdb.getRecList' => \&getRecList, 84 84 'dnsdb.getRecCount' => \&getRecCount, 85 'dnsdb.addRec' => \& addRec,85 'dnsdb.addRec' => \&rpc_addRec, 86 86 'dnsdb.updateRec' => \&updateRec, 87 87 #sub downconvert { … … 462 462 } 463 463 464 sub addRec {464 sub rpc_addRec { 465 465 my %args = @_; 466 466 … … 489 489 die "$msg\n" if $code eq 'FAIL'; 490 490 return $msg; 491 } 491 } # rpc_addRec 492 492 493 493 sub updateRec { … … 508 508 } 509 509 # stamp has special handling when blank or 0. "undefined" from the caller should mean "don't change" 510 $args{stamp} = $oldrec->{stamp} if !defined($args{stamp}) && defined($oldrec->{stamp});510 $args{stamp} = $oldrec->{stamp} if !defined($args{stamp}) && $oldrec->{stampactive}; 511 511 512 512 # allow passing text types rather than DNS integer IDs … … 545 545 # Aren't Magic Numbers Fun? See pseudotype list in dnsadmin. 546 546 my $type = ($cidr->{isv6} ? 65284 : ($cidr->masklen == 32 ? 65280 : 65283) ); 547 addRec(defrec =>'n', revrec => 'y', parent_id => $zonelist->[0]->{rdns_id}, type => $type,547 rpc_addRec(defrec => 'n', revrec => 'y', parent_id => $zonelist->[0]->{rdns_id}, type => $type, 548 548 address => "$cidr", %args); 549 549 } else { … … 554 554 || $rec->{type} == 65282 || $rec->{type} == 65283 || $rec->{type} == 65284; 555 555 next unless $rec->{val} eq $filt; # make sure we really update the record we want to update. 556 $dnsdb->updateRec(defrec =>'n', revrec => 'y', id => $rec->{record_id},556 updateRec(defrec =>'n', revrec => 'y', id => $rec->{record_id}, 557 557 parent_id => $zonelist->[0]->{rdns_id}, %args); 558 558 $flag = 1; … … 563 563 # Aren't Magic Numbers Fun? See pseudotype list in dnsadmin. 564 564 my $type = ($cidr->{isv6} ? 65282 : ($cidr->masklen == 32 ? 65280 : 65283) ); 565 $dnsdb->addRec(defrec =>'n', revrec => 'y', parent_id => $zonelist->[0]->{rdns_id}, type => $type,565 rpc_addRec(defrec => 'n', revrec => 'y', parent_id => $zonelist->[0]->{rdns_id}, type => $type, 566 566 address => "$cidr", %args); 567 567 } … … 578 578 if (scalar(@$reclist) == 0) { 579 579 my $type = ($args{cidr}->{isv6} ? 65282 : ($args{cidr}->masklen == 32 ? 65280 : 65283) ); 580 $dnsdb->addRec(defrec =>'n', revrec => 'y', parent_id => $zdata->{rdns_id}, type => $type,580 rpc_addRec(defrec => 'n', revrec => 'y', parent_id => $zdata->{rdns_id}, type => $type, 581 581 address => "$args{cidr}", %args); 582 582 } else { … … 644 644 # Edge case; we've just gone and axed all the records in the reverse zone. 645 645 # Re-add one to match the parent if we've been given a pattern to use. 646 $dnsdb->addRec(defrec =>'n', revrec => 'y', parent_id => $zonelist->[0]->{rdns_id},646 rpc_addRec(defrec => 'n', revrec => 'y', parent_id => $zonelist->[0]->{rdns_id}, 647 647 type => ($zone->{isv6} ? 65284 : 65283), address => "$cidr", %args); 648 648 } … … 686 686 # yes, yes we do, past the close of the else 687 687 # my $type = ($args{cidr}->{isv6} ? 65282 : ($args{cidr}->masklen == 32 ? 65280 : 65283) ); 688 # addRec(defrec =>'n', revrec => 'y', parent_id => $zdata->{rdns_id}, type => $type,688 # rpc_addRec(defrec => 'n', revrec => 'y', parent_id => $zdata->{rdns_id}, type => $type, 689 689 # address => "$args{cidr}", %args); 690 690 } else { … … 706 706 # We've just gone and axed all the records in the reverse zone. 707 707 # Re-add one to match the parent if we've been given a pattern to use. 708 $dnsdb->addRec(defrec =>'n', revrec => 'y', parent_id => $zdata->{rdns_id},708 rpc_addRec(defrec => 'n', revrec => 'y', parent_id => $zdata->{rdns_id}, 709 709 type => ($cidr->{isv6} ? 65284 : 65283), 710 710 address => $zdata->{revnet}, name => $args{parpatt}, %args);
Note:
See TracChangeset
for help on using the changeset viewer.