1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-10 16:46:50 +02:00

Various banlist/logging updates

This commit is contained in:
e107steved
2007-12-26 13:21:34 +00:00
parent 0b7bdffe3c
commit 9162ce692a
11 changed files with 204 additions and 99 deletions

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/class2.php,v $
| $Revision: 1.35 $
| $Date: 2007-12-22 12:39:23 $
| $Revision: 1.36 $
| $Date: 2007-12-26 13:21:34 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@@ -910,7 +910,7 @@ function js_location($qry){
exit;
} else {
echo "<script type='text/javascript'>document.location.href='{$qry}'</script>\n"; exit;
}
}
}
function check_email($email) {
@@ -1103,8 +1103,10 @@ function save_prefs($table = 'core', $uid = USERID, $row_val = '')
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
class e_online {
function online($online_tracking = false, $flood_control = false) {
class e_online
{
function online($online_tracking = false, $flood_control = false)
{
if($online_tracking == true || $flood_control == true)
{
global $online_timeout, $online_warncount, $online_bancount;
@@ -1129,7 +1131,8 @@ class e_online {
if (USER)
{
// Find record that matches IP or visitor, or matches user info
if ($sql->db_Select("online", "*", "(`online_ip` = '{$ip}' AND `online_user_id` = '0') OR `online_user_id` = '{$udata}'")) {
if ($sql->db_Select("online", "*", "(`online_ip` = '{$ip}' AND `online_user_id` = '0') OR `online_user_id` = '{$udata}'"))
{
$row = $sql->db_Fetch();
if ($row['online_user_id'] == $udata) {
@@ -1160,7 +1163,9 @@ class e_online {
}
}
$sql->db_Update("online", $query);
} else {
}
else
{
$sql->db_Insert("online", " '".time()."', '0', '{$udata}', '{$ip}', '{$page}', 1, 0");
}
}
@@ -1194,10 +1199,12 @@ class e_online {
if ($row['online_pagecount'] > $online_bancount && ($row['online_ip'] != "127.0.0.1"))
{
// $sql->db_Insert("banlist", "'{$ip}', '0', 'Hit count exceeded ({$row['online_pagecount']} requests within allotted time)' ");
$e107->add_ban(2,"Hit count exceeded ({$row['online_pagecount']} requests within allotted time)",$ip,0);
if ($e107->add_ban(2,"Hit count exceeded ({$row['online_pagecount']} requests within allotted time)",$ip,0))
{
$e_event->trigger("flood", $ip);
exit;
}
}
if ($row['online_pagecount'] >= $online_warncount && $row['online_ip'] != "127.0.0.1")
{
echo "<div style='text-align:center; font: 11px verdana, tahoma, arial, helvetica, sans-serif;'><b>".LAN_WARNING."</b><br /><br />".CORE_LAN6."<br /></div>";