Ignore:
Timestamp:
11/16/11 16:28:37 (13 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Prep-for-release cleanup of buglets found making sure the demo
install works

  • Clean up instructions for creating the database. Apparently the PL/pgSQL "language" module required for the last-modified triggers can't be installed by a regular user, and isn't available by default. O_o
  • Fix a missed $IPDB::webpath-in-single-quotes
  • Add a quick hack to allow automagical allocation from private net ranges. See #38.
  • Partially convert some critical bits to use bound parameters in SQL for new allocations. See #34, mostly cleaned up already on /trunk or /branches/htmlform
  • Set $privdata = internally so that an allocation via admin tools doesn't error out
File:
1 edited

Legend:

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

    r445 r508  
    7272our $syslog_facility = 'local2';
    7373
     74# Allow allocations to come from private IP ranges by default?
     75# Set to 'y' or 'on' to enable.
     76our $allowprivrange = '';
     77
    7478# Let's initialize the globals.
    7579## IPDB::initIPDBGlobals()
     
    312316sub allocateBlock {
    313317  my ($dbh,undef,undef,$custid,$type,$city,$desc,$notes,$circid,$privdata,$nodeid) = @_;
     318  $privdata = '' if !defined($privdata);
    314319
    315320  my $cidr = new NetAddr::IP $_[1];
     
    399404          $sth = $dbh->prepare("insert into allocations".
    400405                " (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;
     406                " values ('$cidr','$custid','$type','$city',?,?,".
     407                $cidr->masklen.",?,?)");
     408          $sth->execute($desc,$notes,$circid,$privdata);
    404409
    405410          # And initialize the pool, if necessary
     
    509514          $sth = $dbh->prepare("insert into allocations (cidr,custid,type,city,".
    510515                "description,notes,maskbits,circuitid,privdata)".
    511                 " values ('$cidr','$custid','$type','$city','$desc','$notes',".
    512                 $cidr->masklen.",'$circid','$privdata')");
    513           $sth->execute;
     516                " values ('$cidr','$custid','$type','$city',?,?,".
     517                $cidr->masklen.",?,?)");
     518          $sth->execute($desc,$notes,$circid,$privdata);
    514519
    515520          # And initialize the pool, if necessary
Note: See TracChangeset for help on using the changeset viewer.