No logging for approved

jork - February 11, 2009 - 19:39
Project:Bad Behavior
Version:6.x-1.0-rc2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

There is no loggin available for approved site visits.

function bb2_approved($settings, $package)
{
// Dirk wanted this
if (is_callable('bb2_approved_callback')) {
bb2_approved_callback($settings, $package);
}

// Decide what to log on approved requests.
if (($settings['verbose'] && $settings['logging']) || empty($package['user_agent'])) {
bb2_db_query(bb2_insert($settings, $package, "00000000"));
}
}

This is because $settings['logging'] does not exists. In the function function bb2_read_settings() this parameter isn't registered. I just enabled it with the following code

// retrieve settings from database
function bb2_read_settings() {
  return array(
    'log_table' => '{bad_behavior_log}',
    'logging' => 'true',
    'strict' => variable_get('badbehavior_strict_checking_enable', 0),
    'verbose' => variable_get('badbehavior_verbose_logging_enable', 0));
}

Maybe a form field with a variable will work better. Since this option will delay your website.

 
 

Drupal is a registered trademark of Dries Buytaert.