[pLog-svn] r3820 - in plugins/trunk: . badbehavior badbehavior/bad-behavior

pwestbro at devel.lifetype.net pwestbro at devel.lifetype.net
Fri Jul 28 17:34:28 GMT 2006


Author: pwestbro
Date: 2006-07-28 17:34:27 +0000 (Fri, 28 Jul 2006)
New Revision: 3820

Modified:
   plugins/trunk/bad-behavior-lifetype.php
   plugins/trunk/badbehavior/bad-behavior/post.inc.php
   plugins/trunk/badbehavior/pluginbadbehavior.class.php
Log:
Fixed a few bugs that were preventing Bad Behavior from being able to write
to the database table.

Fixed a bug in the user agent validation.  (I have submitted this to the Bad
Behavior team)


Modified: plugins/trunk/bad-behavior-lifetype.php
===================================================================
--- plugins/trunk/bad-behavior-lifetype.php	2006-07-28 10:26:59 UTC (rev 3819)
+++ plugins/trunk/bad-behavior-lifetype.php	2006-07-28 17:34:27 UTC (rev 3820)
@@ -67,7 +67,7 @@
 	    $result = $db->Execute( $query );
 	
 		if (!$result)
-			return false;
+			return FALSE;
 
 		return $result;
 	}
@@ -95,13 +95,13 @@
 	    include_once( PLOG_CLASS_PATH."class/config/config.class.php" );    
 		$config =& Config::getConfig();
 		$prefix = Db::getPrefix();
-		$logTable = $config->getValue( 'bb2_log_table', 'bad_behavior' );
+		$logTable = $config->getValue( 'bb2_log_table', $prefix . 'bad_behavior' );
 		$displayStats = $config->getValue( 'bb2_display_stats', true );
 		$strict = $config->getValue( 'bb2_strict', false );
 		$verbose = $config->getValue( 'bb2_verbose', false );
 		$isInstalled = $config->getValue( 'bb2_installed', false );
 		
-		return array('log_table' => $prefix . $logTable, 
+		return array('log_table' => $logTable, 
 					 'display_stats' => $displayStats,
 					 'strict' => $strict,
 					 'verbose' => $verbose,

Modified: plugins/trunk/badbehavior/bad-behavior/post.inc.php
===================================================================
--- plugins/trunk/badbehavior/bad-behavior/post.inc.php	2006-07-28 10:26:59 UTC (rev 3819)
+++ plugins/trunk/badbehavior/bad-behavior/post.inc.php	2006-07-28 17:34:27 UTC (rev 3820)
@@ -50,7 +50,7 @@
 		// Screen for user agent changes
 		// User connected previously with blank user agent
 		$q = bb2_db_query("SELECT `ip` FROM " . $settings['log_table'] . " WHERE (`ip` = '" . $package['ip'] . "' OR `ip` = '" . $screener[1] . "') AND `user_agent` = '' AND `date` > DATE_SUB('" . bb2_db_date() . "', INTERVAL 1 MINUTE)");
-		if ($q !== FALSE && $q != NULL)
+		if ($q !== FALSE && $q != NULL && bb2_db_num_rows($q) > 0)
 			return "799165c2";
 
 	}

Modified: plugins/trunk/badbehavior/pluginbadbehavior.class.php
===================================================================
--- plugins/trunk/badbehavior/pluginbadbehavior.class.php	2006-07-28 10:26:59 UTC (rev 3819)
+++ plugins/trunk/badbehavior/pluginbadbehavior.class.php	2006-07-28 17:34:27 UTC (rev 3820)
@@ -22,7 +22,7 @@
 			$this->db =& Db::getDb();
 			
 			$config =& Config::getConfig();
-			$this->_logTable = $config->getValue( 'bb2_display_stats' );
+			$this->_logTable = $config->getValue( 'bb2_log_table' );
 			$this->_displayStatus = $config->getValue( 'bb2_display_stats' );
 		}
 
@@ -68,7 +68,7 @@
         	$row = $result->FetchRow();
 
 			// get current user locale
-			$locale = $this->_blogInfo->getLocale();
+			$locale =& $this->blogInfo->getLocale();
 
 			return $locale->pr( 'bb2_status', $row['counter'] );
         }



More information about the pLog-svn mailing list