Changeset 66 for trunk/dnsbl/DNSBLweb.pm
- Timestamp:
- 01/05/18 18:06:47 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dnsbl/DNSBLweb.pm
r59 r66 21 21 22 22 package DNSBLweb; 23 24 use strict; 25 use warnings; 23 26 24 27 use Exporter; … … 56 59 my $pblock = $args{block} || '0/0'; 57 60 58 my $basesql = "SELECT b.block,o.orgname,b.listme,o.listme,b.comments,o.comments ".61 my $basesql = "SELECT b.block,o.orgname,b.listme,o.listme,b.comments,o.comments,b.exclude ". 59 62 "FROM blocks b INNER JOIN orgs o ON b.orgid=o.orgid ". 60 63 "WHERE b.block <<="; … … 62 65 my $sthiplist = $dbh->prepare("SELECT * FROM iplist WHERE ip <<= ? ORDER BY ip"); 63 66 $allsth->execute($pblock,$lvl); 64 while (my ($block,$org,$listmeb,$listmeo,$bcomments,$ocomments ) = $allsth->fetchrow_array) {67 while (my ($block,$org,$listmeb,$listmeo,$bcomments,$ocomments,$bexclude) = $allsth->fetchrow_array) { 65 68 my $tmpl = new HTML::Template(filename => "browse-block.tmpl"); 66 69 my $blockcidr = new NetAddr::IP $block; 67 70 $tmpl->param(lvlclass => "lvl$lvl".($dnsbl->autolist_block($block) ? " auto$lvl" : ''). 68 71 ( $ipcidr->within($blockcidr) ? ' inhere' : '')); 69 70 $tmpl->param(netclass => ($ listmeb ? "b$lvl".'list' : ''));72 # exclude takes precedence over listme 73 $tmpl->param(netclass => ($bexclude ? 'exclude' : ($listmeb ? "b$lvl".'list' : ''))); 71 74 $tmpl->param(net => $block); 72 75 $tmpl->param(orgclass => ($listmeo ? "b$lvl".'org' : '')); … … 81 84 next if $args{ipseen}->{$data4[0]}; 82 85 my %iprow; 86 my @ipclass; 83 87 $iprow{ip} = $data4[0]; 84 88 $iprow{ipcount} = $data4[1]; 85 89 $iprow{indent} = ' 'x$lvl; 86 $iprow{repeater} = 1 if $ip eq $data4[0]; 87 # ip | count | s4list | added 90 push @ipclass, 'repeater' if $ip eq $data4[0]; 91 push @ipclass, 'exclude' if $data4[5]; 92 $iprow{ipclass} = join(' ', @ipclass); 93 # ip | count | s4list | added | parent | exclude 88 94 push @iprows, \%iprow; 89 95 $args{ipseen}->{$data4[0]} = 1;
Note:
See TracChangeset
for help on using the changeset viewer.