Changeset 24


Ignore:
Timestamp:
09/02/10 17:52:48 (14 years ago)
Author:
Kris Deugau
Message:

/trunk/dnsbl

Add code to override autolist thresholds from database table

Location:
trunk/dnsbl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dnsbl/DNSBL.pm

    r23 r24  
    4444# probably needs some tuning;  even 7 hits in a /24 is a pretty small percentage
    4545# number of IPs in a block of the given masklength needed to have that block automatically listed
     46# defaults: (overridden by entries in db:autolist)
    4647our %autolist = (
    4748        31 => 1,
     
    121122        })
    122123        or die "database inaccessible: ".$DBI::errstr;
     124  my $sth = $dbh->prepare("SELECT masklen,ipcount FROM autolist");
     125  $sth->execute;
     126  while (my ($masklen,$ipcount) = $sth->fetchrow_array) {
     127    $autolist{$masklen} = $ipcount;
     128  }
    123129  return $dbh;
    124130}
  • trunk/dnsbl/dnsbl.cgi

    r22 r24  
    2222my $dnsbl = new DNSBL;
    2323
     24print "Content-type: text/html\n\n";
     25
    2426my $dbh = $dnsbl->connect;
    25 
    26 print "Content-type: text/html\n\n";
    2727
    2828my $page;
Note: See TracChangeset for help on using the changeset viewer.