From 9bf33e5ac8afc192b32e5c5132407d2fd394cecd Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 15 Nov 2004 21:17:25 +0000 Subject: - Added generic flood control mechanism to throttle certain operations per hostname (eg. posting comments, requesting passwords, sending e-mails). See flood_register_event() and flood_is_allowed() for details. --- modules/watchdog.module | 3 ++- modules/watchdog/watchdog.module | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/watchdog.module b/modules/watchdog.module index 89f2d4f70..6aebf299c 100644 --- a/modules/watchdog.module +++ b/modules/watchdog.module @@ -71,10 +71,11 @@ function watchdog_perm() { /** * Implementation of hook_cron(). * - * Remove expired log messages. + * Remove expired log messages and flood control events. */ function watchdog_cron() { db_query('DELETE FROM {watchdog} WHERE timestamp < %d', time() - variable_get('watchdog_clear', 604800)); + db_query('DELETE FROM {flood} WHERE timestamp < %d', time() - 3600); } /** diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module index 89f2d4f70..6aebf299c 100644 --- a/modules/watchdog/watchdog.module +++ b/modules/watchdog/watchdog.module @@ -71,10 +71,11 @@ function watchdog_perm() { /** * Implementation of hook_cron(). * - * Remove expired log messages. + * Remove expired log messages and flood control events. */ function watchdog_cron() { db_query('DELETE FROM {watchdog} WHERE timestamp < %d', time() - variable_get('watchdog_clear', 604800)); + db_query('DELETE FROM {flood} WHERE timestamp < %d', time() - 3600); } /** -- cgit v1.2.3