Changeset 699
- Timestamp:
- 02/20/15 18:15:14 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r698 r699 1237 1237 # Retrieve some odds and ends for defaults on the IPs 1238 1238 my ($pcustid) = $dbh->selectrow_array("SELECT def_custid FROM alloctypes WHERE type=?", undef, ($type) ); 1239 my ($vrf,$vlan ) = $dbh->selectrow_array("SELECT vrf,vlanFROM allocations WHERE id = ?",1239 my ($vrf,$vlan,$master) = $dbh->selectrow_array("SELECT vrf,vlan,master_id FROM allocations WHERE id = ?", 1240 1240 undef, ($parent) ); 1241 1241 … … 1252 1252 eval { 1253 1253 # have to insert all pool IPs into poolips table as "unallocated". 1254 $sth = $dbh->prepare("INSERT INTO poolips (ip,custid,city,type,parent_id ) VALUES (?,?,?,?,?)");1254 $sth = $dbh->prepare("INSERT INTO poolips (ip,custid,city,type,parent_id,master_id) VALUES (?,?,?,?,?,?)"); 1255 1255 1256 1256 # in case of pool extension by some means, we need to see what IPs were already inserted … … 1288 1288 my $baseip = $poolip_list[$i]->addr; 1289 1289 if ($baseip !~ /\.(?:0|255)$/ && !$foundips{$poolip_list[$i]}) { 1290 $sth->execute($baseip, $pcustid, $city, $type, $parent );1290 $sth->execute($baseip, $pcustid, $city, $type, $parent, $master); 1291 1291 } 1292 1292 } … … 1296 1296 if ($class eq 'all') { # (DSL-ish block - *all* IPs available 1297 1297 if ($pool->addr !~ /\.0$/) { # .0 causes weirdness. 1298 $sth->execute($pool->addr, $pcustid, $city, $type, $parent ) unless $foundips{$pool->addr};1299 } 1300 $sth->execute($poolip_list[0]->addr, $pcustid, $city, $type, $parent ) unless $foundips{$poolip_list[0]};1298 $sth->execute($pool->addr, $pcustid, $city, $type, $parent, $master) unless $foundips{$pool->addr}; 1299 } 1300 $sth->execute($poolip_list[0]->addr, $pcustid, $city, $type, $parent, $master) unless $foundips{$poolip_list[0]}; 1301 1301 $pool--; 1302 1302 if ($pool->addr !~ /\.255$/) { # .255 can cause weirdness. 1303 $sth->execute($pool->addr, $pcustid, $city, $type, $parent ) unless $foundips{$pool->addr};1303 $sth->execute($pool->addr, $pcustid, $city, $type, $parent, $master) unless $foundips{$pool->addr}; 1304 1304 } 1305 1305 }
Note:
See TracChangeset
for help on using the changeset viewer.