Changeset 768
- Timestamp:
- 08/24/15 18:17:49 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r764 r768 1178 1178 1179 1179 my $plist = $dbh->selectall_arrayref( q( 1180 SELECT count(*) AS poolfree,p.poolAS poolblock, a.city AS poolcit1180 SELECT a.id as poolid,count(*) AS poolfree,a.cidr AS poolblock, a.city AS poolcit 1181 1181 FROM poolips p 1182 1182 JOIN allocations a ON p.parent_id=a.id 1183 1183 WHERE p.available='y' AND a.city = ? AND p.type LIKE ? 1184 GROUP BY p.pool,a.city 1184 GROUP BY a.id,a.cidr,a.city 1185 ORDER BY a.cidr 1185 1186 ), 1186 1187 { Slice => {} }, ($pcity, $ptype) ); … … 1381 1382 my %args = @_; 1382 1383 1383 $args{cidr} = new NetAddr::IP $args{cidr}; 1384 if ($args{cidr} eq 'Single static IP') { 1385 $args{cidr} = ''; 1386 } else { 1387 $args{cidr} = new NetAddr::IP $args{cidr}; 1388 } 1384 1389 1385 1390 $args{desc} = '' if !$args{desc}; … … 1393 1398 # Could arguably allow this for eg /120 allocations, but end users who get a single v4 IP are 1394 1399 # usually given a v6 /64, and most v6 addressing schemes need at least half that address space 1395 if ($args{cidr} ->{isv6} && $args{rdns} =~ /\%/) {1400 if ($args{cidr} && $args{cidr}->{isv6} && $args{rdns} =~ /\%/) { 1396 1401 return ('FAIL','Reverse DNS template patterns are not supported for IPv6 allocations'); 1397 1402 } … … 1426 1431 if $isavail eq 'n'; 1427 1432 } else { # IP not specified, take first available 1428 ($args{cidr}) = $dbh->selectrow_array("SELECT ip FROM poolips WHERE p ool=? AND available='y' ORDER BY ip",1429 undef, ($args{ alloc_from}) );1433 ($args{cidr}) = $dbh->selectrow_array("SELECT ip FROM poolips WHERE parent_id=? AND available='y' ORDER BY ip", 1434 undef, ($args{parent}) ); 1430 1435 } 1431 1436 $dbh->do("UPDATE poolips SET custid = ?, city = ?,available='n', description = ?, notes = ?, ".
Note:
See TracChangeset
for help on using the changeset viewer.