[pLog-svn] r3820 - in plugins/trunk: .
badbehaviorbadbehavior/bad-behavior
Mark Wu
markplace at gmail.com
Fri Jul 28 19:28:17 GMT 2006
Hi Paul:
1. Why we need to do this changes? What's the difference between false and
FALSE?
2. About the log_table, I prefer save it into config table without prefix.
Because I want to prevent user change his table prefix in some day future
for some reason ... :( That's why I remove it.
Mark
> -----Original Message-----
> From: plog-svn-bounces at devel.lifetype.net
> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of
> pwestbro at devel.lifetype.net
> Sent: Saturday, July 29, 2006 1:34 AM
> To: plog-svn at devel.lifetype.net
> Subject: [pLog-svn] r3820 - in plugins/trunk: .
> badbehaviorbadbehavior/bad-behavior
>
> 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'] );
> }
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.lifetype.net/mailman/listinfo/plog-svn
More information about the pLog-svn
mailing list