- Location:
- trunk/vb3
- Files:
-
- 4 edited
-
upload/includes/bad-behavior/screener.inc.php (modified) (1 diff)
-
upload/includes/functions_vb_badbehavior.php (modified) (1 diff)
-
upload/admincp/vb_badbehavior.php (modified) (6 diffs)
-
product-vb_badbehavior.xml (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/vb3/upload/includes/bad-behavior/screener.inc.php
r6 r17 6 6 { 7 7 // FIXME: Set the real cookie 8 setcookie($cookie_name, $cookie_value, 0, bb2_relative_path());8 @setcookie($cookie_name, $cookie_value, 0, bb2_relative_path()); 9 9 } 10 10 -
trunk/vb3/upload/includes/functions_vb_badbehavior.php
r6 r17 330 330 } 331 331 332 // Helper function for bb2_log_userid() 333 function __walker($var) 334 { 335 return (strpos($var, 'Cookie') !== false); 336 } 337 338 // Determines if vB Bad Behavior has blocked a user request 339 // Checks to see of userid is present in the Cookie header 340 function bb2_log_userid($headers) 341 { 342 if (!empty($headers)) 343 { 344 $_tmp = explode("\n", $headers); 345 $_tmp = implode('', array_filter($_tmp, '__walker')); 346 $_tmp = str_replace(';', '&', $_tmp); 347 348 if (empty($_tmp)) 349 { 350 return false; 351 } 352 parse_str($_tmp); 353 354 $userid = COOKIE_PREFIX . 'userid'; 355 return $$userid; 356 } 357 return false; 358 } 359 332 360 // Calls inward to Bad Behavor itself. 333 361 require_once(BB2_CWD . '/bad-behavior/core.inc.php'); -
trunk/vb3/upload/admincp/vb_badbehavior.php
r6 r17 94 94 } 95 95 96 // Need to filter out any keys? 97 $filterkeysql = ''; 98 99 if (!empty($vbulletin->options['vb_badbehavior_log_filter'])) 100 { 101 $filterkeys = explode("\n", trim($vbulletin->options['vb_badbehavior_log_filter'])); 102 103 foreach ($filterkeys AS $filterkey) 104 { 105 $filterkeysql .= "'" . $db->escape_string($filterkey) . "',"; 106 } 107 unset($filterkeys); 108 109 $filterkeysql = trim($filterkeysql, ','); 110 } 111 112 // 96 113 $counter = $db->query_first(" 97 114 SELECT COUNT(*) AS total 98 115 FROM " . TABLE_PREFIX . "vb_badbehavior 116 " . iif($filterkeysql, "WHERE `key` NOT IN($filterkeysql)") . " 99 117 "); 100 118 … … 128 146 SELECT * 129 147 FROM " . TABLE_PREFIX . "vb_badbehavior 148 " . iif($filterkeysql, "WHERE `key` NOT IN($filterkeysql)") . " 130 149 ORDER BY $order 131 150 LIMIT $startat, {$vbulletin->GPC['perpage']} … … 175 194 while ($log = $db->fetch_array($logs)) 176 195 { 196 $userid = bb2_log_userid($log['http_headers']); 197 177 198 print_cells_row(array( 178 $log['ip'] ,199 $log['ip'] . iif($userid !== false, "<br />UserID:<a href=\"member.php?{$vbulletin->session->vars['sessionurl']}u=$userid\" target=\"_blank\">$userid</a>"), 179 200 $log['date'], 180 201 "<a href=\"#\" onclick=\"window.open('vb_badbehavior.php?{$vbulletin->session->vars['sessionurl']}do=keycheck&key=$log[key]', 'keycheck', 'width=200,height=200');return false;\">$log[key]</a>", … … 203 224 )); 204 225 226 $datecut = TIMENOW - (86400 * $vbulletin->GPC['daysprune']); 227 205 228 $logs = $db->query_first(" 206 229 SELECT COUNT(*) AS total 207 230 FROM " . TABLE_PREFIX . "vb_badbehavior 208 WHERE date < DATE_SUB(NOW(), INTERVAL {$vbulletin->GPC['daysprune']} DAY)231 WHERE UNIX_TIMESTAMP(date) < $datecut 209 232 "); 210 233 … … 212 235 { 213 236 print_form_header('vb_badbehavior', 'doprunelog'); 214 construct_hidden_code('daysprune', $ vbulletin->GPC['daysprune']);237 construct_hidden_code('daysprune', $datecut); 215 238 print_table_header($vbphrase['prune_vb_badbehavior_logs']); 216 239 print_description_row(construct_phrase( … … 235 258 $db->query_write(" 236 259 DELETE FROM " . TABLE_PREFIX . "vb_badbehavior 237 WHERE date < DATE_SUB(NOW(), INTERVAL {$vbulletin->GPC['daysprune']} DAY)260 WHERE UNIX_TIMESTAMP(date) < {$vbulletin->GPC['daysprune']} 238 261 "); 239 262 -
trunk/vb3/product-vb_badbehavior.xml
r6 r17 87 87 <phrase name="setting_vb_badbehavior_verbose_desc" date="1301856755" username="Eric" version="1.0.0"><![CDATA[Turning on verbose mode causes all HTTP requests to be logged. When verbose mode is off, only blocked requests and a few suspicious (but permitted) requests are blocked.<br /><br />Verbose mode is off by default. Using verbose mode is not recommended as it can significantly slow down your site; it exists to capture data from live spammers which are not being blocked.]]></phrase> 88 88 <phrase name="setting_vb_badbehavior_httpbl_key_title" date="1301856755" username="Eric" version="1.0.0"><![CDATA[http:BL API Key]]></phrase> 89 <phrase name="setting_vb_badbehavior_httpbl_key_desc" date="130 1856755" username="Eric" version="1.0.0"><![CDATA[Bad Behavior is capable of using data from the <a href="http://www.projecthoneypot.org/faq.php#g" target="_blank">http:BL</a> service provided by <a href="http://www.projecthoneypot.org/" target="_blank">Project Honey Pot</a> to screen requests.<br /><br />This is purely optional; however if you wish to use it, you must <a href="http://www.projecthoneypot.org/account_login.php" target="_blank">sign up for the service</a> and obtain an API key. To disable http:BL use, remove the API key from your settings.]]></phrase>89 <phrase name="setting_vb_badbehavior_httpbl_key_desc" date="1302825836" username="Eric" version="1.0.3-dev"><![CDATA[Bad Behavior is capable of using data from the <a href="http://www.projecthoneypot.org/faq.php#g" target="_blank">http:BL</a> service provided by <a href="http://www.projecthoneypot.org/" target="_blank">Project Honey Pot</a> to screen requests.<br /><br />This is purely optional; however if you wish to use it, you must <a href="http://www.projecthoneypot.org/httpbl_configure.php" target="_blank">sign up for the service</a> and obtain an API key. To disable http:BL use, remove the API key from your settings.]]></phrase> 90 90 <phrase name="setting_vb_badbehavior_httpbl_threat_title" date="1301856755" username="Eric" version="1.0.0"><![CDATA[http:BL Threat Level]]></phrase> 91 91 <phrase name="setting_vb_badbehavior_httpbl_threat_desc" date="1301856755" username="Eric" version="1.0.0"><![CDATA[This number provides a measure of how suspicious an IP address is, based on activity observed at Project Honey Pot. Bad Behavior will block requests with a threat level equal or higher to this setting. Project Honey Pot has <a href="http://www.projecthoneypot.org/threat_info.php" target="_blank">more information on this parameter</a>.]]></phrase> … … 98 98 <phrase name="setting_vb_badbehavior_reverse_proxy_addresses_title" date="1301856755" username="Eric" version="1.0.0"><![CDATA[Reverse Proxy Addresses]]></phrase> 99 99 <phrase name="setting_vb_badbehavior_reverse_proxy_addresses_desc" date="1301856755" username="Eric" version="1.0.0"><![CDATA[IP address or CIDR netblocks which Bad Behavior trusts to provide reliable information in the HTTP header given above. If no addresses are given, Bad Behavior will assume that the HTTP header given is always trustworthy and that the right-most IP address appearing in the header is correct.<br /><br />If you have a chain of two or more proxies this is probably not what you want; in this scenario you should either set this option and provide all proxy server IP addresses (or ranges) which could conceivably handle the request, or have your edge servers set a unique HTTP header with the client's IP address.<br /><br />For instance, when using CloudFlare, it is impossible to provide a list of IP addresses, so you would set the HTTP header to CloudFlare's provided "CF-Connecting-IP" header instead.<br /><br /><strong style="color: #ff0000;">NOTE: Enter one ip address/CIDR netblock per line.</strong>]]></phrase> 100 <phrase name="setting_vb_badbehavior_log_filter_title" date="1303159579" username="Eric" version="1.0.3-dev"><![CDATA[Log Filter Keys]]></phrase> 101 <phrase name="setting_vb_badbehavior_log_filter_desc" date="1303159579" username="Eric" version="1.0.3-dev"><![CDATA[Enter a list of keys you want filtered out of the log results. Please make sure you place each key on a separate line.]]></phrase> 100 102 <phrase name="settinggroup_vb_badbehavior" date="1301856755" username="Eric" version="1.0.0"><![CDATA[vB Bad Behavior Options]]></phrase> 101 103 </phrasetype> … … 148 150 <optioncode>textarea</optioncode> 149 151 </setting> 152 <setting varname="vb_badbehavior_log_filter" displayorder="110"> 153 <datatype>free</datatype> 154 <optioncode>textarea</optioncode> 155 <defaultvalue>00000000</defaultvalue> 156 </setting> 150 157 </settinggroup> 151 158 </options>
Note: See TracChangeset
for help on using the changeset viewer.