diff options
author | Simon Rettberg | 2017-11-03 13:30:13 +0100 |
---|---|---|
committer | Simon Rettberg | 2017-11-03 13:30:13 +0100 |
commit | 78e604444fe0314942edb2d88194f76e67588725 (patch) | |
tree | 42ea446d1d2381b78ad292a2e994314401808850 /modules-available | |
parent | [statistics] api: Allow specifying client type (diff) | |
download | slx-admin-78e604444fe0314942edb2d88194f76e67588725.tar.gz slx-admin-78e604444fe0314942edb2d88194f76e67588725.tar.xz slx-admin-78e604444fe0314942edb2d88194f76e67588725.zip |
[syslog] api: Relax spam protection
Diffstat (limited to 'modules-available')
-rw-r--r-- | modules-available/syslog/api.inc.php | 6 |
1 files changed, 4 insertions, 2 deletions
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, |