Changeset 66 for trunk/dnsbl/dnsbl.cgi
- Timestamp:
- 01/05/18 18:06:47 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dnsbl/dnsbl.cgi
r64 r66 62 62 my $cfgname = $ENV{SERVER_NAME}.$ENV{REQUEST_URI}; 63 63 $cfgname =~ s|[./-]|_|g; 64 $cfgname =~ s|_dnsbl_cgi. +||;64 $cfgname =~ s|_dnsbl_cgi.*||; 65 65 $cfgname =~ s|_$||; 66 66 if (-e "/etc/dnsbl/$cfgname.conf") { … … 124 124 } 125 125 126 my $count = $dnsbl->ipexists($webvar{ip}); 127 $page->param(nreports => $count) if $count; 126 my $ipinfo = $dnsbl->ipexists($webvar{ip}); 127 $page->param(nreports => $ipinfo->[0]) if $ipinfo; 128 $page->param(ipexclude => $ipinfo->[1]) if $ipinfo; 129 # extract and list the entire tree the IP is part of 128 130 $page->param(browsebits => 129 131 DNSBLweb::retlvl($dbh, $dnsbl, 0, ip => $webvar{ip}, block => $dnsbl->getcontainer($webvar{ip},0) )); 130 132 for (my $i=0; $i <= $maxlvl; $i++) { 131 my ($block,$ org) = $dnsbl->getcontainer($webvar{ip},$i);133 my ($block,$comment,$org) = $dnsbl->getcontainer($webvar{ip},$i); 132 134 if ($block) { 133 my ($bcl,$bal) = $dnsbl->islisted($block); 135 $page->param("comment$i" => $comment); 136 my ($bcl,$bal,$bwl) = $dnsbl->islisted($block); 134 137 $page->param("autob$i" => $bcl); 135 $page->param("listb$i" => $bal); 138 $page->param("flag$i" => ($bwl ? 'exclude' : ($bal ? 'b1list' : '')) ); 139 $page->param("excl$i" => $bwl); 136 140 my ($ol) = $dnsbl->islisted($org); 137 141 $page->param("listorg$i" => $ol); … … 159 163 my $orgn = "org$i"; 160 164 my $blockn = "block$i"; 165 my $commentn = "comment$i"; 166 my $excln = "exclude$i"; 161 167 $webvar{$orgn} =~ s/^\s*//; 162 168 $webvar{$orgn} =~ s/\s*$//; 163 169 $webvar{$blockn} =~ s/^\s*//; 164 170 $webvar{$blockn} =~ s/\s*$//; 171 $webvar{$commentn} =~ s/^\s*//; 172 $webvar{$commentn} =~ s/\s*$//; 173 $webvar{$excln} =~ s/on/1/; 165 174 my $orgid = $dnsbl->orgexists($webvar{$orgn}); 166 175 if (!$orgid) { … … 180 189 } 181 190 if (!$dnsbl->blockexists($webvar{$blockn})) { 182 my $ret = $dnsbl->addblock($webvar{$blockn}, $orgid, $i );191 my $ret = $dnsbl->addblock($webvar{$blockn}, $orgid, $i, $webvar{$excln}); 183 192 $err .= "error adding $webvar{$blockn}: $ret<br>\n" if $ret; 184 193 $page->param($blockn => $webvar{$blockn}); 194 } else { 195 my $ret = $dnsbl->updateblock($webvar{$blockn}, $orgid, $i, $webvar{$excln}, $webvar{$commentn}); 196 $err .= "error updating $webvar{$blockn}: $ret<br>\n" if $ret; 185 197 } 186 198 last unless $webvar{"block".($i+1)}; 187 199 } 188 200 189 my $count = $dnsbl->report($webvar{ip} );201 my $count = $dnsbl->report($webvar{ip}, $webvar{excludeip}); 190 202 191 203 $page->param(ip => $webvar{ip});
Note:
See TracChangeset
for help on using the changeset viewer.