Changeset 920
- Timestamp:
- 10/12/18 13:38:05 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r915 r920 1340 1340 my $pcity = shift; 1341 1341 1342 my $rangelimit = shift; 1343 if ($rangelimit) { 1344 if ($rangelimit !~ /^[\d\.\/]+$/) { 1345 # Just skip limiting on ridiculous range limits 1346 $rangelimit = ''; 1347 } else { 1348 # now check for sanity 1349 $rangelimit = new NetAddr::IP $rangelimit; 1350 $rangelimit = '' if !$rangelimit; 1351 } 1352 } 1353 1342 1354 my ($ptype) = ($iptype =~ /^(.)i$/); 1343 1355 return if !$ptype; 1344 1356 $ptype .= '_'; 1357 1358 my @qargs = ($pcity, $ptype); 1359 push @qargs, "$rangelimit" if $rangelimit; 1345 1360 1346 1361 my $plist = $dbh->selectall_arrayref( q( … … 1348 1363 FROM poolips p 1349 1364 JOIN allocations a ON p.parent_id=a.id 1350 WHERE p.available='y' AND a.city = ? AND p.type LIKE ? 1365 WHERE p.available='y' AND a.city = ? AND p.type LIKE ?). 1366 ($rangelimit ? ' AND a.cidr << ?' : '').q( 1351 1367 GROUP BY a.id,a.cidr,a.city 1352 1368 ORDER BY a.cidr 1353 1369 ), 1354 { Slice => {} }, ($pcity, $ptype));1370 { Slice => {} }, @qargs ); 1355 1371 return $plist; 1356 1372 } # end getPoolSelect()
Note:
See TracChangeset
for help on using the changeset viewer.