Changeset 477 for trunk/dns-rpc.cgi


Ignore:
Timestamp:
03/13/13 17:10:34 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Object conversion of DNSDB.pm, 11 of <mumble>. See #11.

  • convert addDomain(), delZone(), addRDNS(), getZoneCount(), getZoneList() getZoneLocation(), zoneStatus(), and getZonesByCIDR() and callers
  • fix a couple of missed utility calls in dns-rpc.cgi as well
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns-rpc.cgi

    r476 r477  
    114114  my $argref = shift;
    115115  if (!$argref->{location} && $argref->{defrec} eq 'n') {
    116     $argref->{location} = DNSDB::getZoneLocation($dbh, $argref->{revrec}, $argref->{parent_id});
     116    $argref->{location} = $dnsdb->getZoneLocation($argref->{revrec}, $argref->{parent_id});
    117117  }
    118118}
     
    142142  _commoncheck(\%args, 'y');
    143143
    144   my ($code, $msg) = DNSDB::addDomain($dbh, $args{domain}, $args{group}, $args{state});
     144  my ($code, $msg) = $dnsdb->addDomain($args{domain}, $args{group}, $args{state});
    145145  die $msg if $code eq 'FAIL';
    146146  return $msg;  # domain ID
     
    156156  # Let's be nice;  delete based on zone id OR zone name.  Saves an RPC call round-trip, maybe.
    157157  if ($args{zone} =~ /^\d+$/) {
    158     ($code,$msg) = DNSDB::delZone($dbh, $args{zone}, $args{revrec});
     158    ($code,$msg) = $dnsdb->delZone($args{zone}, $args{revrec});
    159159  } else {
    160160    my $zoneid;
    161     $zoneid = DNSDB::domainID($dbh, $args{zone}) if $args{revrec} eq 'n';
    162     $zoneid = DNSDB::revID($dbh, $args{zone}) if $args{revrec} eq 'y';
    163     die "Can't find zone: $DNSDB::errstr\n" if !$zoneid;
    164     ($code,$msg) = DNSDB::delZone($dbh, $zoneid, $args{revrec});
     161    $zoneid = $dnsdb->domainID($args{zone}) if $args{revrec} eq 'n';
     162    $zoneid = $dnsdb->revID($args{zone}) if $args{revrec} eq 'y';
     163    die "Can't find zone: $dnsdb->errstr\n" if !$zoneid;
     164    ($code,$msg) = $dnsdb->delZone($zoneid, $args{revrec});
    165165  }
    166166  die $msg if $code eq 'FAIL';
     
    178178  _commoncheck(\%args, 'y');
    179179
    180   my ($code, $msg) = DNSDB::addRDNS($dbh, $args{revzone}, $args{revpatt}, $args{group}, $args{state}, $args{defloc});
     180  my ($code, $msg) = $dnsdb->addRDNS($args{revzone}, $args{revpatt}, $args{group}, $args{state}, $args{defloc});
    181181  die "$msg\n" if $code eq 'FAIL';
    182182  return $msg;  # domain ID
     
    431431  my $cidr = new NetAddr::IP $args{cidr};
    432432
    433   my $zonelist = DNSDB::getZonesByCIDR($dbh, %args);
     433  my $zonelist = $dnsdb->getZonesByCIDR(%args);
    434434  if (scalar(@$zonelist) == 0) {
    435435    # enhh....  WTF?
     
    511511
    512512  # much like addOrUpdateRevRec()
    513   my $zonelist = DNSDB::getZonesByCIDR($dbh, %args);
     513  my $zonelist = $dnsdb->getZonesByCIDR(%args);
    514514  my $cidr = new NetAddr::IP $args{cidr};
    515515
     
    633633  _commoncheck(\%args, 'y');
    634634
    635   my @arglist = ($dbh, $args{zoneid});
     635  my @arglist = ($args{zoneid});
    636636  push @arglist, $args{status} if defined($args{status});
    637637
    638   my $status = DNSDB::zoneStatus(@arglist);
     638  my $status = $dnsdb->zoneStatus(@arglist);
    639639}
    640640
     
    645645  _commoncheck(\%args, 'y');
    646646
    647   return DNSDB::getZonesByCIDR($dbh, %args);
     647  return $dnsdb->getZonesByCIDR(%args);
    648648}
    649649
Note: See TracChangeset for help on using the changeset viewer.