Ignore:
Timestamp:
11/12/12 17:31:34 (12 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Commit semihack allocate-from-browsed-freeblock changes to stable branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/cgi-bin/IPDB.pm

    r549 r550  
    345345#       and available='y' order by ip limit 1);
    346346
    347       $sth = $dbh->prepare("select ip from poolips where pool='$alloc_from'".
    348         " and available='y' order by ip");
    349       $sth->execute;
    350 
    351       my @data = $sth->fetchrow_array;
    352       $cidr = $data[0];  # $cidr is already declared when we get here!
     347# If no specific IP was requested, pick the next available one from the pool.
     348      if (!$cidr) {
     349        $sth = $dbh->prepare("select ip from poolips where pool='$alloc_from'".
     350          " and available='y' order by ip");
     351        $sth->execute;
     352
     353        my @data = $sth->fetchrow_array;
     354        $cidr = $data[0];  # $cidr is already declared when we get here!
     355      }
    353356
    354357      $sth = $dbh->prepare("update poolips set custid='$custid',".
Note: See TracChangeset for help on using the changeset viewer.