Changeset 26
- Timestamp:
- 02/13/05 23:47:36
- Files:
-
- trunk/plugins/dnsbl/dnsbl.pl (modified) (6 diffs)
- trunk/plugins/dnsbl/tmpl/dnsbl.tmpl (modified) (1 diff)
- trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plugins/dnsbl/dnsbl.pl
r24 r26 38 38 qw( comment_filter ping_filter 39 39 allow_auth allow_urlless allow_priorurls 40 pingip_check 40 41 ipbl_enabled ipbl_moderate ipbl_service 41 42 domainbl_enabled domainbl_moderate domainbl_service … … 82 83 $data->{allow_urlless} = 0 unless exists $data->{allow_urlless}; 83 84 $data->{allow_priorurls} = 0 unless exists $data->{allow_priorurls}; 85 $data->{pingip_check} = 1 unless exists $data->{pingip_check}; 84 86 85 87 $data->{ipbl_enabled} = 1 unless exists $data->{ipbl_enabled}; … … 170 172 my @tests; 171 173 push @tests, \&priorurl_check if $data->{allow_priorurls} && $data->{source_url}; 174 push @tests, \&pingip_check if $data->{pingip_check} && $data->{pingip_check} && $data->{__type} ne 'comment'; 172 175 push @tests, \&cache_check if $data->{caching_enabled} && $data->{cache_limit}; 173 176 push @tests, \&headers_check if $data->{headers_enabled}; … … 244 247 ## Each returns one of three states: 0 to reject, 1 to accept, undef 245 248 ## to ignore, allowing the next test to run. 249 250 sub pingip_check { 251 my ($eh, $app, $obj, $data) = @_; 252 253 my $pingip = $obj->ip; 254 my $domain = extract_urls($obj->source_url, 1); 255 my $domainip = checkdns($domain); 256 return BLOCK unless $domainip; # domain is not registered yet... do not 257 # accept 258 259 return IGNORE if $pingip eq $domainip; 260 261 # test for class C ip match 262 $domainip =~ s/\.\d+$//; 263 $pingip =~ s/\.\d+$//; 264 return IGNORE if $pingip eq $domainip; 265 266 return BLOCK; 267 } 246 268 247 269 sub priorurl_check { … … 436 458 437 459 sub extract_urls { 438 my ($str ) = @_;460 my ($str, $single) = @_; 439 461 440 462 # unmunge so we can see encoded urls as well … … 456 478 next; 457 479 } 480 return $domain if $single; 458 481 my $last = $#parts; 459 482 my $start = length($parts[$last]) < 3 ? 2 : 1; trunk/plugins/dnsbl/tmpl/dnsbl.tmpl
r22 r26 33 33 <input type="checkbox" name="allow_auth" value="1" <TMPL_IF NAME=ALLOW_AUTH>checked="checked"</TMPL_IF> /> Don't filter comments from valid TypeKey identities.<br /> 34 34 <input type="checkbox" name="allow_urlless" value="1" <TMPL_IF NAME=ALLOW_URLLESS>checked="checked"</TMPL_IF> /> Only filter comments with hyperlinks (approves comments with no discernable URL).<br /> 35 <input type="checkbox" name="allow_priorurls" value="1" <TMPL_IF NAME=ALLOW_PRIORURLS>checked="checked"</TMPL_IF> /> Allow comments whose URL matches a previously approved commenter URL (only takes effect if no URLs are present in comment body). 35 <input type="checkbox" name="allow_priorurls" value="1" <TMPL_IF NAME=ALLOW_PRIORURLS>checked="checked"</TMPL_IF> /> Allow comments whose URL matches a previously approved commenter URL (only takes effect if no URLs are present in comment body).<br /> 36 <input type="checkbox" name="pingip_check" value="1" <TMPL_IF NAME=PINGIP_CHECK>checked="checked"</TMPL_IF> /> Block TrackBack pings whose IP does not match the IP address for the source URL. 36 37 </p> 37 38 trunk/readme.txt
r23 r26 110 110 a previously approved comment's URL (but only if the text of the 111 111 comment itself contains no additional URLs). 112 * Added option to block pings whose IP does not match the IP address 113 of the source URL. 112 114 113 115 11/5/2004 - 1.1 release
