Changeset 536 for trunk/cgi-bin/main.cgi
- Timestamp:
- 10/31/12 17:56:03 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/main.cgi
r534 r536 328 328 # Snag the type of the container block from the database. 329 329 ## hmm. need a flag for parent class/type, sort of? 330 my $pblock = getParent($ip_dbh, $webvar{block});330 my $pblock = subParent($ip_dbh, $webvar{block}); 331 331 my $ptype = $pblock->{type}; 332 332 $ptype =~ s/c$/r/; … … 616 616 ##fixme: hook to force-set POP or city on certain alloctypes 617 617 # if ($webvar{alloctype =~ /foo,bar,bz/ { $webvar{pop} = 'blah'; } 618 if ($webvar{pop} =~ /^-$/) {618 if ($webvar{pop} && $webvar{pop} =~ /^-$/) { 619 619 $flag = 'to route the block from/through'; 620 620 } … … 722 722 return if !validateInput; 723 723 724 $webvar{swip} = 'n' if !$webvar{swip}; 725 724 726 my %updargs = ( 725 727 custid => $webvar{custid}, … … 730 732 block => $webvar{block}, 731 733 type => $webvar{alloctype}, 734 swip => $webvar{swip}, 732 735 ); 733 736 … … 760 763 761 764 # Link back to browse-routed or list-pool page on "Update complete" page. 762 my $cblock; # to contain the CIDR of the container block we're retrieving. 763 my $sql; 765 my $cblock; 764 766 if (my $pooltype = ($webvar{alloctype} =~ /^(.)i$/) ) { 765 767 $page->param(backpool => 1); 766 $ sql = "select pool from poolips where ip='$webvar{block}'";768 $cblock = ipParent($ip_dbh, $webvar{block}); 767 769 } else { 768 $sql = "select cidr from routed where cidr >>= '$webvar{block}'"; 769 } 770 # I define there to be no errors on this operation... so we don't need to check for them. 771 $sth = $ip_dbh->prepare($sql); 772 $sth->execute; 773 $sth->bind_columns(\$cblock); 774 $sth->fetch(); 775 $sth->finish; 776 $page->param(backblock => $cblock); 770 $cblock = blockParent($ip_dbh, $webvar{block}); 771 } 772 $page->param(backblock => $cblock->{cidr}); 773 774 # Do some HTML fiddling here instead of using ESCAPE=HTML in the template, 775 # because otherwise we can't convert \n to <br>. *sigh* 776 $webvar{notes} = $q->escapeHTML($webvar{notes}); # escape first... 777 $webvar{notes} =~ s/\n/<br>\n/; # ... then convert newlines 778 $webvar{privdata} = ($webvar{privdata} ? $q->escapeHTML($webvar{privdata}) : " "); 779 $webvar{privdata} =~ s/\n/<br>\n/; 777 780 778 781 $page->param(cidr => $webvar{block}); … … 781 784 $page->param(custid => $webvar{custid}); 782 785 $page->param(swip => $webvar{swip} eq 'on' ? 'Yes' : 'No'); 783 $page->param(circid => $q->escapeHTML($webvar{circid})); 784 $page->param(desc => $q->escapeHTML($webvar{desc})); 785 $page->param(notes => $q->escapeHTML($webvar{notes})); 786 $webvar{privdata} = ($webvar{privdata} ? $q->escapeHTML($webvar{privdata}) : " "); 786 $page->param(circid => $webvar{circid}); 787 $page->param(desc => $webvar{desc}); 788 $page->param(notes => $webvar{notes}); 787 789 $page->param(privdata => $webvar{privdata}) 788 790 if $IPDBacl{$authuser} =~ /s/;
Note:
See TracChangeset
for help on using the changeset viewer.