Changeset 186 for trunk/cgi-bin/main.cgi
- Timestamp:
- 03/03/05 17:14:54 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/main.cgi
r184 r186 331 331 $data[2] .= 'i'; 332 332 } 333 my @row = (qq(<a href="/ip/cgi-bin/main.cgi?action=edit&block=$data[0]">$data[0]</a>), 333 my @row = ( (($data[2] =~ /^l.$/) ? 'Sub ' : ''). 334 qq(<a href="/ip/cgi-bin/main.cgi?action=edit&block=$data[0]">$data[0]</a>), 334 335 $data[1], $disp_alloctypes{$data[2]}, $data[3], $data[4]); 335 336 # Allow listing of pool if desired/required. … … 598 599 # $data[2] =~ s/\s+//g; 599 600 600 my @row = ("<a href=\"/ip/cgi-bin/main.cgi?action=edit&block=$data[0]\">$data[0]</a>", 601 my @row = ( (($data[2] =~ /^l.$/) ? 'Sub ' : ''). 602 qq(<a href="/ip/cgi-bin/main.cgi?action=edit&block=$data[0]">$data[0]</a>), 601 603 $data[1], $disp_alloctypes{$data[2]}, $data[3], $data[4]); 602 604 # If the allocation is a pool, allow listing of the IPs in the pool. … … 634 636 # unrouted free blocks, but it's better to let the database do the work if we can. 635 637 $count = 0; 636 $sth = $ip_dbh->prepare("select cidr from freeblocks where routed='y' and cidr <<= '$master' order by cidr"); 638 $sth = $ip_dbh->prepare("select cidr,routed from freeblocks where cidr <<= '$master'". 639 " order by cidr"); 637 640 $sth->execute(); 638 641 while (my @data = $sth->fetchrow_array()) { 639 # cidr, maskbits,city642 # cidr,routed 640 643 my $cidr = new NetAddr::IP $data[0]; 641 my @row = ("<a href=\"/ip/cgi-bin/main.cgi?action=assign&block=$cidr\">$cidr</a>", 644 my @row = ((($data[1] eq 'r') ? 'Sub ' : ''). 645 "<a href=\"/ip/cgi-bin/main.cgi?action=assign&block=$cidr\">$cidr</a>", 642 646 $cidr->range); 643 647 printRow(\@row, 'color1') if ($count%2 == 0); … … 869 873 if ($webvar{allocfrom} ne '-') { 870 874 $sql = "select cidr from freeblocks where city='$city' and maskbits<=$webvar{maskbits}". 871 " and cidr <<= '$webvar{allocfrom}' and routed='y' order by cidr,maskbits desc"; 875 " and cidr <<= '$webvar{allocfrom}' and routed='". 876 (($webvar{alloctype} =~ /^l.$/) ? 'r' : 'y')."' order by cidr,maskbits desc"; 872 877 } else { 873 878 $sql = "select cidr from freeblocks where city='$city' and maskbits<=$webvar{maskbits}". 874 " and routed='y' order by cidr,maskbits desc"; 879 " and routed='".(($webvar{alloctype} =~ /^l.$/) ? 'r' : 'y'). 880 "' order by cidr,maskbits desc"; 875 881 } 876 882 }
Note:
See TracChangeset
for help on using the changeset viewer.