function getEventList() {
$this->_initSettings();
- return array('QuickMenu','PreAddComment','PreSkinParse','ValidateForm', 'SpamCheck');
+ return array('QuickMenu','PreAddComment','ValidateForm', 'SpamCheck');
}
function hasAdminArea() {
}
function blacklist($type, $testString, $ipblock = true) {
- global $DIR_PLUGINS;
+ global $DIR_PLUGINS, $member;
if( $this->resultCache )
return $this->resultCache . '[Cached]';
+ if( $member->isLoggedIn() ){
+ return '';
+ }
+
if ($this->getOption('enabled') == 'yes') {
// update the blacklist first file
//pbl_updateblacklist($this->getOption('update'),false);
define('NP_BLACKLIST_CACHE_GC_INTERVAL', NP_BLACKLIST_CACHE_LIFE/8);
define('NP_BLACKLIST_CACHE_GC_TIMESTAMP', 'gctime');
define('NP_BLACKLIST_CACHE_GC_TIMESTAMP_LIFE', NP_BLACKLIST_CACHE_LIFE*3);
-//require_once(dirname(__FILE__).'/cache_file.php');
-require_once(dirname(__FILE__).'/cache_eaccelerator.php');
+require_once(dirname(__FILE__).'/cache_file.php');
+//require_once(dirname(__FILE__).'/cache_eaccelerator.php');
function pbl_getconfig() {
global $pbl_config;
if (strlen($domain_to_test) > 3)
{
$domain_to_test = $domain_to_test . ".multi.surbl.org";
- if( strstr(gethostbyname($domain_to_test),'127.0.0')) {
+ if( strpos(gethostbyname($domain_to_test),'127.0.0') !== false) {
return true;
}
}
function check_for_iprbl () {
if( pbl_ipcache_read() ) return false;
- //$iprbl = array('sc.surbl.org', 'bsb.spamlookup.net', 'opm.blitzed.org', 'list.dsbl.org');
- $iprbl = array('niku.2ch.net', 'list.dsbl.org', 'bsb.spamlookup.net');
-
$spammer_ip = serverVar('REMOTE_ADDR');
+ if( strpos( $spammer_ip,'127.0.0') !== false ){
+ return false;
+ }
+
+ $iprbl = array('niku.2ch.net', 'list.dsbl.org', 'bsb.spamlookup.net');
list($a, $b, $c, $d) = explode('.', $spammer_ip);
foreach($iprbl as $rbl ){
- if( strstr( gethostbyname( "$d.$c.$b.$a.$rbl" ),'127.0.0') ) {
+ if( strpos( gethostbyname( "$d.$c.$b.$a.$rbl" ),'127.0.0') !== false ) {
return array($rbl, $spammer_ip);
}
}
foreach($domainrbl as $rbl ){
if (strlen($domain_to_test) > 3)
{
- if( strstr(gethostbyname($domain_to_test.'.'.$rbl),'127.0.0')) {
+ if( strpos(gethostbyname($domain_to_test.'.'.$rbl),'127.0.0') ==! false) {
return array($rbl, $domain_to_test);
}
}
}
}
if ($type != "ip") {
- $htaccess .= "\nRewriteRule .* ?¿½ [F,L]\n";
+ $htaccess .= "\nRewriteRule .* � [F,L]\n";
}
return $htaccess;
}
}
if (isset($_POST["type"])) {
- if (strstr(postVar("type"),"blocked")) {
+ if ( strpos(postVar("type"),"blocked") !== false ) {
$type = 'ip';
} else {
$type = 'rules';
<?php
/**
-* cache_eaccelerator.php ($Revision: 1.3 $)
+* cache_eaccelerator.php ($Revision: 1.4 $)
*
* by hsur ( http://blog.cles.jp/np_cles )
-* $Id: cache_eaccelerator.php,v 1.3 2006-10-17 15:37:58 hsur Exp $
+* $Id: cache_eaccelerator.php,v 1.4 2006-11-26 05:52:33 hsur Exp $
*/
function pbl_ipcache_write(){
$key = sprintf("BL%u", ip2long(serverVar('REMOTE_ADDR')));
- if( ! rand(0,19) ) pbl_ipcache_gc();
+ if( ! rand(0,100) ) pbl_ipcache_gc();
// eAccelerator Cache
eaccelerator_lock($key);
- eaccelerator_put($key, true, NP_BLACKLIST_CACHE_LIFE);
+ eaccelerator_put($key, '1', NP_BLACKLIST_CACHE_LIFE);
eaccelerator_unlock($key);
}