Changeset 590


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
Files:
3 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});
  • trunk/templates/delete.tmpl

    r589 r590  
    33<br>
    44
     5<form action="main.cgi" method="POST" class="regular">
     6<fieldset><legend class="noshow">&nbsp;</legend>
    57<table class="indent" cellspacing="1" cellpadding="1">
    68
     
    6668<tr class="row<TMPL_IF privdata>0<TMPL_ELSE>1</TMPL_IF>">
    6769<td class="center" colspan="2">
    68 <form action="main.cgi" method="POST" class="regular">
    69 <fieldset><legend class="noshow">&nbsp;</legend>
    7070<input type="button" value="Back" onclick="history.go(-1)"><input type="submit" value="Confirm">
    7171<input type="hidden" name="block" value="<TMPL_VAR NAME=block>">
    7272<input type="hidden" name="rdepth" value="<TMPL_VAR NAME=rdepth>">
    7373<input type="hidden" name="action" value="finaldelete">
    74 </fieldset>
    75 </form>
    7674</td>
    7775</tr>
    7876
    7977</table>
     78</fieldset>
     79</form>
Note: See TracChangeset for help on using the changeset viewer.