Changeset 21

Show
Ignore:
Timestamp:
02/10/05 20:01:52
Author:
brad
Message:

Added option to allow through comments without any URLs.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plugins/dnsbl/dnsbl.pl

    r20 r21  
    3131use constant IGNORE => undef; 
    3232 
    33  
    3433sub instance { 
    3534    $plugin; 
     
    3736 
    38371; 
     38 
    3939__DATA__ 
    4040sub config_params { 
    4141    qw( comment_filter ping_filter 
    42         allow_auth 
     42        allow_auth allow_urlless 
    4343        ipbl_enabled ipbl_moderate ipbl_service 
    4444        domainbl_enabled domainbl_moderate domainbl_service 
     
    8484    $data->{ping_filter} = 1 unless exists $data->{ping_filter}; 
    8585    $data->{allow_auth} = 0 unless exists $data->{allow_auth}; 
     86    $data->{allow_urlless} = 0 unless exists $data->{allow_urlless}; 
    8687 
    8788    $data->{ipbl_enabled} = 1 unless exists $data->{ipbl_enabled}; 
     
    122123        return 1 unless $data->{comment_filter}; 
    123124 
     125        $data->{__type} = 'comment'; 
     126 
    124127        # comment 
    125         if ($data->{domainbl_enabled}) { 
    126             @urls = extract_urls($obj->text); 
    127             push @urls, extract_urls($obj->url) if $obj->url; 
    128         } 
    129         $data->{__type} = 'comment'; 
     128        @urls = extract_urls($obj->text); 
     129        push @urls, extract_urls($obj->url) if $obj->url; 
     130 
     131        return 1 if scalar(@urls) == 0 && $data->{allow_urlless}; 
    130132 
    131133        if ($data->{allow_auth}) { 
     
    144146 
    145147        $data->{__type} = 'Trackback ping'; 
     148 
    146149        if ($data->{domainbl_enabled}) { 
    147150            @urls = extract_urls($obj->excerpt); 
  • trunk/plugins/dnsbl/tmpl/dnsbl.tmpl

    r17 r21  
    3131    <input type="checkbox" name="comment_filter" value="1" <TMPL_IF NAME=COMMENT_FILTER>checked="checked"</TMPL_IF> /> Filter inbound comments<br /> 
    3232    <input type="checkbox" name="ping_filter" value="1" <TMPL_IF NAME=PING_FILTER>checked="checked"</TMPL_IF> /> Filter inbound Trackback pings<br /> 
    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. 
     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    <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). 
    3435    </p> 
    3536 
  • trunk/readme.txt

    r19 r21  
    105105    * Added a configuration screen. 
    106106    * Removed requirement of Net::DNS package. 
     107    * Added option granting a free pass for authenticated commenters. 
     108    * Added option granting a free pass for comments without any URLs. 
    107109 
    10811011/5/2004 - 1.1 release