Changeset 448 for branches/htmlform/cgi-bin/IPDB.pm
- Timestamp:
- 07/27/10 13:56:39 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/htmlform/cgi-bin/IPDB.pm
r443 r448 347 347 $cidr = $data[0]; # $cidr is already declared when we get here! 348 348 349 $sth = $dbh->prepare("update poolips set custid='$custid',". 350 "city='$city',available='n',description='$desc',notes='$notes',". 351 "circuitid='$circid',privdata='$privdata'". 352 " where ip='$cidr'"); 353 $sth->execute; 349 $sth = $dbh->prepare("update poolips set custid=?,city=?,". 350 "available='n',description=?,notes=?,circuitid=?,privdata=?". 351 " where ip=?"); 352 $sth->execute($custid, $city, $desc, $notes, $circid, $privdata, "$cidr"); 354 353 # node hack 355 354 if ($nodeid && $nodeid ne '') { … … 399 398 $sth = $dbh->prepare("insert into allocations". 400 399 " (cidr,custid,type,city,description,notes,maskbits,circuitid,privdata)". 401 " values ('$cidr','$custid','$type','$city','$desc','$notes',". 402 $cidr->masklen.",'$circid','$privdata')"); 403 $sth->execute; 400 " values (?,?,?,?,?,?,?,?,?)"); 401 $sth->execute("$cidr", $custid, $type, $city, $desc, $notes, $cidr->masklen, $circid, $privdata); 404 402 405 403 # And initialize the pool, if necessary … … 509 507 $sth = $dbh->prepare("insert into allocations (cidr,custid,type,city,". 510 508 "description,notes,maskbits,circuitid,privdata)". 511 " values ('$cidr','$custid','$type','$city','$desc','$notes',". 512 $cidr->masklen.",'$circid','$privdata')"); 513 $sth->execute; 509 " values (?,?,?,?,?,?,?,?,?)"); 510 $sth->execute("$cidr", $custid, $type, $city, $desc, $notes, $cidr->masklen, $circid, $privdata); 514 511 515 512 # And initialize the pool, if necessary … … 633 630 eval { 634 631 $msg = "Unable to deallocate $disp_alloctypes{$type} $cidr"; 635 $sth = $dbh->prepare("update poolips set custid= '$defcustid',available='y',".636 "city=(select city from allocations where cidr >>= '$cidr'".632 $sth = $dbh->prepare("update poolips set custid=?,available='y',". 633 "city=(select city from allocations where cidr >>= ?". 637 634 " order by masklen(cidr) desc limit 1),". 638 "description='',notes='',circuitid='' where ip= '$cidr'");639 $sth->execute ;635 "description='',notes='',circuitid='' where ip=?"); 636 $sth->execute($defcustid, "$cidr", "$cidr"); 640 637 $dbh->commit; 641 638 };
Note:
See TracChangeset
for help on using the changeset viewer.