- Timestamp:
- 01/25/13 16:16:04 (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r590 r591 254 254 sub addMaster { 255 255 my $dbh = shift; 256 # warning! during testing, this somehow generated a "Bad file descriptor" error. O_o 256 257 my $cidr = new NetAddr::IP shift; 257 258 my %args = @_; … … 1261 1262 eval { $dbh->rollback; }; 1262 1263 return ('FAIL', $msg); 1264 } 1265 1266 # Have to handle potentially split reverse zones. Assume they *are* split, 1267 # since if we added them here, they would have been added split. 1268 # allow splitting reverse zones to be disabled, maybe, someday 1269 #if ($splitrevzones && !$cidr->{isv6}) { 1270 my @zonelist; 1271 if (1 && !$cidr->{isv6}) { 1272 my $splitpoint = ($cidr->masklen <= 16 ? 16 : 24); # hack pthui 1273 @zonelist = $cidr->split($splitpoint); 1263 1274 } else { 1264 ##fixme: RPC return code? 1265 _rpc('delZone', zone => "$cidr", user => $user, revrec => 'y'); 1266 return ('OK',"OK"); 1267 } 1275 @zonelist = ($cidr); 1276 } 1277 my @fails; 1278 foreach my $subzone (@zonelist) { 1279 if ($rpc_url && !_rpc('delZone', zone => "$subzone", revrec => 'y', user => $user, delforward => $delfwd) ) { 1280 push @fails, ("$subzone" => $errstr); 1281 } 1282 } 1283 if (@fails) { 1284 return ('WARN',"Warning(s) deleting $cidr from reverse DNS:\n".join("\n", @fails)); 1285 } 1286 return ('OK','OK'); 1268 1287 1269 1288 } else { # end alloctype master block case … … 1275 1294 1276 1295 my $retcode = 'OK'; 1296 my ($ptype,$pcity,$ppatt); 1277 1297 1278 1298 eval { … … 1289 1309 1290 1310 ##fixme: we could maybe eliminate a special case if we put masterblocks in the allocations table...? 1291 my ($ptype,$pcity);1292 1311 if ($rdepth == 1) { 1293 1312 # parent is a master block. 1294 1313 $ptype = 'mm'; 1295 1314 $pcity = '<NULL>'; 1315 $ppatt = $dbh->selectrow_array("SELECT rdns FROM masterblocks WHERE cidr=?", undef, ($parent) ); 1296 1316 } else { 1297 1317 # get that parent's details 1298 ($ptype,$pcity ) = $dbh->selectrow_array("SELECT type,cityFROM allocations ".1318 ($ptype,$pcity,$ppatt) = $dbh->selectrow_array("SELECT type,city,rdns FROM allocations ". 1299 1319 "WHERE cidr=? AND rdepth=?", undef, ($parent, $rdepth-1) ); 1300 1320 } … … 1321 1341 $pcity = $tcity; 1322 1342 ##fixme: hmm. collect $rdepth into $goback here before vanishing? 1323 $retcode = 'WARN '; # may be redundant1343 $retcode = 'WARNMERGE'; # may be redundant 1324 1344 $goback = $tparent; 1325 1345 # munge freeblock rdepth and parent to match true parent … … 1435 1455 } else { 1436 1456 ##fixme: RPC return code? 1437 _rpc('delByCIDR', cidr => "$cidr", user => $user, delforward => $delfwd, delsubs => 'y' );1457 _rpc('delByCIDR', cidr => "$cidr", user => $user, delforward => $delfwd, delsubs => 'y', parpatt => $ppatt); 1438 1458 return ($retcode, $goback); 1439 1459 } -
trunk/cgi-bin/main.cgi
r590 r591 895 895 $page->param(delparent => $blockinfo->{parent}) if $webvar{rdepth}; 896 896 $page->param(prdepth => $webvar{rdepth}); 897 if ($code =~ /^WARN /) {897 if ($code =~ /^WARN(POOL|MERGE)/) { 898 898 my ($bp,$bd) = split /,/, $msg; 899 899 $page->param(bparent => $bp); … … 901 901 $page->param(mergeip => $code eq 'WARNPOOL'); 902 902 } 903 903 if ($code eq 'WARN') { 904 $msg =~ s/\n/<br>\n/g; 905 $page->param(genwarn => $msg); 906 } 904 907 if ($code eq 'OK' || $code =~ /^WARN/) { 905 908 syslog "notice", "$authuser deallocated '$webvar{alloctype}'-type netblock $webvar{block} ". -
trunk/templates/finaldelete.tmpl
r577 r591 5 5 <TMPL_ELSE> 6 6 <div class="heading">Success! <TMPL_VAR NAME=block> deallocated.</div> 7 <TMPL_IF genwarn><br><div><TMPL_VAR NAME=genwarn></div></TMPL_IF> 7 8 <TMPL_IF bparent><br><div> 8 9 Warning:
Note:
See TracChangeset
for help on using the changeset viewer.