added masslog warning from following, updates #217, updates #206

This commit is contained in:
Nils Bohrs
2013-07-17 13:00:55 +02:00
committed by following
parent c6fa97b794
commit bd33e67c90
3 changed files with 51 additions and 3 deletions
+41 -1
View File
@@ -292,5 +292,45 @@ class cachelog
0,
$cacheId, $userId, $logType, $logDate, $logText) != 0);
}
static function isMasslogging($userId)
{
// check for wrong-dated mass logs
$rs = sql("
SELECT `date`, `text`
FROM `cache_logs`
WHERE `id`= (
SELECT `id`
FROM `cache_logs`
WHERE `user_id`='&1'
ORDER BY `date_created` DESC,
`id` DESC
LIMIT 1)",
$userId);
$rLastLog = sql_fetch_array($rs);
sql_free_result($rs);
if ($rLastLog)
{
$rs = sql("
SELECT COUNT(*) as `masslogs`
FROM `cache_logs`
WHERE `user_id`='&1'
AND `date`='&2'
AND `text`='&3'",
$userId,
$rLastLog['date'],
$rLastLog['text']);
$r = sql_fetch_array($rs);
$masslogs = $r['masslogs'];
sql_free_result($rs);
}
else
$masslogs = 0;
return ($masslogs > 20);
}
}
?>
?>