Changeset 659 for trunk/dns-rpc.cgi


Ignore:
Timestamp:
09/12/14 18:00:03 (10 years ago)
Author:
Kris Deugau
Message:

/trunk

Shave off a confusing nuisance in naming; rename addRec() to rpc_addRec()
in dns-rpc.cgi. Now we can tell more easily whether this is a local
redirect call or (supposed to be) a call to the core DNSDB::addRec()...
and therefore what calling convention we use.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns-rpc.cgi

    r543 r659  
    8383        'dnsdb.getRecList'      => \&getRecList,
    8484        'dnsdb.getRecCount'     => \&getRecCount,
    85         'dnsdb.addRec'          => \&addRec,
     85        'dnsdb.addRec'          => \&rpc_addRec,
    8686        'dnsdb.updateRec'       => \&updateRec,
    8787#sub downconvert {
     
    462462}
    463463
    464 sub addRec {
     464sub rpc_addRec {
    465465  my %args = @_;
    466466
     
    489489  die "$msg\n" if $code eq 'FAIL';
    490490  return $msg;
    491 }
     491} # rpc_addRec
    492492
    493493sub updateRec {
     
    508508  }
    509509  # 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};
    511511
    512512  # allow passing text types rather than DNS integer IDs
     
    545545        # Aren't Magic Numbers Fun?  See pseudotype list in dnsadmin.
    546546        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,
    548548          address => "$cidr", %args);
    549549      } else {
     
    554554                || $rec->{type} == 65282 || $rec->{type} == 65283 || $rec->{type} == 65284;
    555555          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},
    557557            parent_id => $zonelist->[0]->{rdns_id}, %args);
    558558          $flag = 1;
     
    563563          # Aren't Magic Numbers Fun?  See pseudotype list in dnsadmin.
    564564          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,
    566566            address => "$cidr", %args);
    567567        }
     
    578578      if (scalar(@$reclist) == 0) {
    579579        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,
    581581          address => "$args{cidr}", %args);
    582582      } else {
     
    644644          # Edge case;  we've just gone and axed all the records in the reverse zone.
    645645          # 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},
    647647                 type => ($zone->{isv6} ? 65284 : 65283), address => "$cidr", %args);
    648648        }
     
    686686# yes, yes we do, past the close of the else
    687687#        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,
    689689#          address => "$args{cidr}", %args);
    690690      } else {
     
    706706        # We've just gone and axed all the records in the reverse zone.
    707707        # 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},
    709709               type => ($cidr->{isv6} ? 65284 : 65283),
    710710               address => $zdata->{revnet}, name => $args{parpatt}, %args);
Note: See TracChangeset for help on using the changeset viewer.