Changeset 633 for trunk/cgi-bin/main.cgi
- Timestamp:
- 10/08/14 18:01:55 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/main.cgi
r631 r633 300 300 301 301 # hack pthbttt eww 302 $webvar{parent} = 0 if !$webvar{parent}; 302 303 $webvar{block} = '' if !$webvar{block}; 303 304 … … 307 308 $page->param(allocfrom => $webvar{block}); # fb-assign flag, if block is set, we're in fb-assign 308 309 309 if ($webvar{ block} ne '') {310 if ($webvar{fbid} || $webvar{fbtype}) { 310 311 311 312 # Common case, according to reported usage. Block to assign is specified. 312 313 my $block = new NetAddr::IP $webvar{block}; 313 $page->param(rdepth => $webvar{rdepth}); 314 315 my $rdns = getBlockRDNS($ip_dbh, $webvar{block}, $webvar{rdepth}, vrf => $webvar{vrf}, user => $authuser); 314 315 my $rdns = getBlockRDNS($ip_dbh, id => $webvar{parent}, type => $webvar{fbtype}, user => $authuser); 316 316 $page->param(rdns => $rdns) if $rdns; 317 $page->param(parent => $webvar{parent}); 318 $page->param(fbid => $webvar{fbid}); 317 319 318 320 $webvar{fbtype} = '' if !$webvar{fbtype}; 319 321 if ($webvar{fbtype} eq 'i') { 320 my $ipinfo = getBlockData($ip_dbh, $block); 322 my $ipinfo = getBlockData($ip_dbh, $webvar{block}, 'i'); 323 my $pinfo = getBlockData($ip_dbh, $webvar{parent}); 321 324 $page->param( 322 325 fbip => 1, 323 block => $ block,326 block => $ipinfo->{block}, 324 327 fbdisptype => $list_alloctypes{$ipinfo->{type}}, 325 328 type => $ipinfo->{type}, 326 allocfrom => $ ipinfo->{pool},329 allocfrom => $pinfo->{block}, 327 330 ); 328 331 } else { … … 340 343 341 344 my @pops; 342 foreach my $pop (@ poplist) {345 foreach my $pop (@citylist) { 343 346 my %row = (pop => $pop); 344 347 push (@pops, \%row); … … 378 381 my $cidr; 379 382 my $alloc_from; 383 my $fbid = $webvar{fbid}; 384 my $p_id = $webvar{parent}; 380 385 381 386 # Going to manually validate some items. … … 428 433 429 434 ## fixme: add rdepth? 430 ($ cidr,$webvar{rdepth}) = findAllocateFrom($ip_dbh, $webvar{maskbits}, $webvar{alloctype}, $webvar{city},431 $webvar{ pop}, (master => $webvar{allocfrom}, allowpriv => $webvar{allowpriv}) );435 ($fbid,$cidr,$p_id) = findAllocateFrom($ip_dbh, $webvar{maskbits}, $webvar{alloctype}, 436 $webvar{city}, $webvar{pop}, (master => $webvar{allocfrom}, allowpriv => $webvar{allowpriv}) ); 432 437 if (!$cidr) { 433 438 $page->param(err => $failmsg); … … 464 469 $page->param(typefull => $q->escapeHTML($disp_alloctypes{$webvar{alloctype}})); 465 470 $page->param(alloc_from => $alloc_from); 466 $page->param(rdepth => $webvar{rdepth}); 471 $page->param(parent => $p_id); 472 $page->param(fbid => $fbid); 467 473 $page->param(cidr => $cidr); 468 474 $page->param(rdns => $webvar{rdns}); … … 514 520 # IP, or the error message if an error occurred. 515 521 516 my ($code,$msg) = allocateBlock($ip_dbh, cidr => $webvar{fullcidr}, alloc_from => $webvar{alloc_from},517 rdepth => $webvar{rdepth}, custid => $webvar{custid}, type => $webvar{alloctype}, city => $webvar{city},522 my ($code,$msg) = allocateBlock($ip_dbh, cidr => $webvar{fullcidr}, fbid => $webvar{fbid}, 523 parent => $webvar{parent}, custid => $webvar{custid}, type => $webvar{alloctype}, city => $webvar{city}, 518 524 desc => $webvar{desc}, notes => $webvar{notes}, circid => $webvar{circid}, 519 525 privdata => $webvar{privdata}, nodeid => $webvar{node}, rdns => $webvar{rdns}, user => $authuser); … … 524 530 $page->param(staticip => $msg); 525 531 $page->param(custid => $webvar{custid}); 526 $page->param(parent => $webvar{ alloc_from}, rdepth => $webvar{rdepth}-1);532 $page->param(parent => $webvar{parent}, pool => $webvar{alloc_from}); 527 533 $page->param(billinguser => $webvar{billinguser}); 528 534 mailNotify($ip_dbh, "a$webvar{alloctype}", "ADDED: $disp_alloctypes{$webvar{alloctype}} allocation", … … 535 541 $page->param(custid => $webvar{custid}); 536 542 # breadcrumbs lite! provide at least a link to the parent of the block we just allocated. 537 my $binfo = getBlockData($ip_dbh, $webvar{fullcidr}, $webvar{rdepth}); 538 $page->param(parent => $binfo->{parent}, rdepth => $binfo->{rdepth}); 543 my $binfo = getBlockData($ip_dbh, $webvar{parent}); 544 $page->param(parentid => $webvar{parent}); 545 $page->param(parentblock => $binfo->{block}); 539 546 if ($webvar{alloctype} eq 'pr' && $webvar{billinguser}) { 540 547 $page->param(billinguser => $webvar{billinguser});
Note:
See TracChangeset
for help on using the changeset viewer.