Changeset 590 for trunk/cgi-bin


Ignore:
Timestamp:
01/22/13 17:31:53 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

RPC integration for allocation-delete should be complete. See #1.
Requires dnsadmin:/trunk@r459 or newer.

  • Pass a couple more bits into deleteBlock()
  • Use the new values when making the RPC call
  • Rearrange the delete-confirm page a little to allow the new "delete forward DNS too?" checkbox to actually contribute
  • Tweak new-allocation RPC call a little; don't bother if no rDNS was passed in.
Location:
trunk/cgi-bin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/IPDB.pm

    r588 r590  
    10321032    } # end fullcidr != alloc_from
    10331033
    1034     # now we do the DNS dance for netblocks, if we have an RPC server to do it with.
    1035     _rpc('addOrUpdateRevRec', cidr => "$args{cidr}", name => $args{rdns}, rpcuser => $args{user});
     1034    # now we do the DNS dance for netblocks, if we have an RPC server to do it with and a pattern to use.
     1035    _rpc('addOrUpdateRevRec', cidr => "$args{cidr}", name => $args{rdns}, rpcuser => $args{user})
     1036      if $args{rdns};
    10361037
    10371038    return ('OK', 'OK');
     
    11841185# Also handles "deleting" a static IP allocation, and removal of a master
    11851186# Requires a database handle, the block to delete, the routing depth (if applicable),
    1186 # and the VRF ID
     1187# the VRF ID, and a flag to indicate whether to delete associated forward DNS entries
     1188# as well as the reverse entry
    11871189sub deleteBlock {
    1188   my ($dbh,undef,$rdepth,$vrf) = @_;
     1190  my ($dbh,undef,$rdepth,$vrf,$delfwd,$user) = @_;
    11891191  my $cidr = new NetAddr::IP $_[1];
    11901192
     
    12401242      return ('FAIL',$msg);
    12411243    } else {
     1244##fixme:  RPC return code?
     1245      _rpc('delByCIDR', cidr => "$cidr", user => $user, delforward => $delfwd);
    12421246      return ('OK',"OK");
    12431247    }
     
    12581262      return ('FAIL', $msg);
    12591263    } else {
     1264##fixme:  RPC return code?
     1265      _rpc('delZone', zone => "$cidr", user => $user, revrec => 'y');
    12601266      return ('OK',"OK");
    12611267    }
     
    14281434      return ('FAIL', $msg);
    14291435    } else {
     1436##fixme:  RPC return code?
     1437      _rpc('delByCIDR', cidr => "$cidr", user => $user, delforward => $delfwd, delsubs => 'y');
    14301438      return ($retcode, $goback);
    14311439    }
  • trunk/cgi-bin/main.cgi

    r589 r590  
    890890  my $blockinfo = getBlockData($ip_dbh, $webvar{block}, $webvar{rdepth});
    891891
    892   my ($code,$msg) = deleteBlock($ip_dbh, $webvar{block}, $webvar{rdepth}, $webvar{vrf});
     892  my ($code,$msg) = deleteBlock($ip_dbh, $webvar{block}, $webvar{rdepth}, $webvar{vrf}, $webvar{delforward}, $authuser);
    893893
    894894  $page->param(block => $webvar{block});
Note: See TracChangeset for help on using the changeset viewer.