From 78e604444fe0314942edb2d88194f76e67588725 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 3 Nov 2017 13:30:13 +0100 Subject: [syslog] api: Relax spam protection --- modules-available/syslog/api.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'modules-available/syslog') diff --git a/modules-available/syslog/api.inc.php b/modules-available/syslog/api.inc.php index 156bc35c..18c42c31 100644 --- a/modules-available/syslog/api.inc.php +++ b/modules-available/syslog/api.inc.php @@ -26,8 +26,10 @@ $longdesc = Request::post('longdesc', '', 'string'); if ($type{0} !== '.' && $type{0} !== '~') { // Spam from IP - $row = Database::queryFirst('SELECT Count(*) AS cnt FROM clientlog WHERE clientip = :client AND dateline + 3600 > UNIX_TIMESTAMP()', array(':client' => $ip)); - if ($row !== false && $row['cnt'] > 150) exit(0); + $row = Database::queryFirst('SELECT Count(*) AS cnt FROM clientlog WHERE clientip = :client AND dateline + 1800 > UNIX_TIMESTAMP()', array(':client' => $ip)); + if ($row !== false && $row['cnt'] > 250) { + exit(0); + } Database::exec('INSERT INTO clientlog (dateline, logtypeid, clientip, machineuuid, description, extra) VALUES (UNIX_TIMESTAMP(), :type, :client, :uuid, :description, :longdesc)', array( 'type' => $type, -- cgit v1.2.3-55-g7522