Changeset 508
- Timestamp:
- 11/16/11 16:28:37 (13 years ago)
- Location:
- branches/stable
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/INSTALL
r507 r508 61 61 b) Edit CustIDCK.pm as needed to validate customer IDs. 62 62 63 4) As a Postgres superuser, create a database user and the database. 64 Create the inital tables using cgi-bin/ipdb.psql. 63 4) As a Postgres superuser, create a database user and the database: 64 65 shell> psql template1 66 pg# create user ipdb with password "ipdbpwd"; 67 pg# create database ipdb owner ipdb; 68 69 Add the PL/pgSQL language to the database. This is not strictly 70 necessary but there are triggers on the poolips and allocations table 71 to automatically update a last-modified column. 72 73 pg# \c ipdb 74 pg# create language plpgsql 75 76 Create the inital tables using cgi-bin/ipdb.psql: 77 78 shell> psql -U ipdb ipdb <cgi-bin/ipdb.psql 65 79 66 80 5) Configure your webserver to call the IPDB scripts at an appropriate -
branches/stable/assign.html
r507 r508 37 37 <tr class="color2"> 38 38 <td>Route/allocate from this master: </td><td>$$MASTERLIST$$ 39 Allow automatic allocation from private IP ranges:<input type=checkbox name=allowpriv>39 Allow automatic allocation from private IP ranges:<input type=checkbox $$ALLOWPRIV$$ name=allowpriv> 40 40 </td> 41 41 </tr><tr class="color1"> -
branches/stable/cgi-bin/IPDB.pm
r445 r508 72 72 our $syslog_facility = 'local2'; 73 73 74 # Allow allocations to come from private IP ranges by default? 75 # Set to 'y' or 'on' to enable. 76 our $allowprivrange = ''; 77 74 78 # Let's initialize the globals. 75 79 ## IPDB::initIPDBGlobals() … … 312 316 sub allocateBlock { 313 317 my ($dbh,undef,undef,$custid,$type,$city,$desc,$notes,$circid,$privdata,$nodeid) = @_; 318 $privdata = '' if !defined($privdata); 314 319 315 320 my $cidr = new NetAddr::IP $_[1]; … … 399 404 $sth = $dbh->prepare("insert into allocations". 400 405 " (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); 404 409 405 410 # And initialize the pool, if necessary … … 509 514 $sth = $dbh->prepare("insert into allocations (cidr,custid,type,city,". 510 515 "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); 514 519 515 520 # And initialize the pool, if necessary -
branches/stable/cgi-bin/MyIPDB.pm
r507 r508 51 51 #$IPDB::syslog_facility = 'daemon'; 52 52 53 # Allow allocations to come from private IP ranges by default? 54 # Set to 'y' or 'on' to enable. 55 #$IPDB::allowprivrange = ''; 53 56 54 57 ## connectDB_My() -
branches/stable/cgi-bin/main.cgi
r507 r508 446 446 # If the allocation is a pool, allow listing of the IPs in the pool. 447 447 if ($data[2] =~ /^.[pd]$/) { 448 $row[0] .= ' <a href="$IPDB::webpath/cgi-bin/main.cgi?action=listpool'.448 $row[0] .= qq( <a href="$IPDB::webpath/cgi-bin/main.cgi?action=listpool). 449 449 "&pool=$data[0]\">List IPs</a>"; 450 450 } … … 583 583 584 584 $html =~ s|\$\$WEBPATH\$\$|$IPDB::webpath|g; 585 if ($IPDB::allowprivrange eq 'y' or $IPDB::allowprivrange eq 'on') { 586 $html =~ s/\$\$ALLOWPRIV\$\$/checked=checked/; 587 } else { 588 $html =~ s/\$\$ALLOWPRIV\$\$//; 589 } 585 590 586 591 # This is a little dangerous, as it's *theoretically* possible to … … 614 619 close HTML; 615 620 $html =~ s|\$\$WEBPATH\$\$|$IPDB::webpath|g; 621 if ($IPDB::allowprivrange eq 'y' or $IPDB::allowprivrange eq 'on') { 622 $html =~ s/\$\$ALLOWPRIV\$\$/checked=checked/; 623 } else { 624 $html =~ s/\$\$ALLOWPRIV\$\$//; 625 } 616 626 my $masterlist = "<select name=allocfrom><option selected>-</option>\n"; 617 627 foreach my $master (@masterblocks) {
Note:
See TracChangeset
for help on using the changeset viewer.