diff options
Diffstat (limited to 'includes/watchdog.inc')
-rw-r--r-- | includes/watchdog.inc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/includes/watchdog.inc b/includes/watchdog.inc index da24d79d8..628fabcca 100644 --- a/includes/watchdog.inc +++ b/includes/watchdog.inc @@ -10,6 +10,7 @@ $watchdog = array("comment" => array("0", $submission_rate["comment"]), function watchdog($id, $message) { global $user, $watchdog, $watchdog_history; + // flood protection: if ($watchdog[$id][1] && !user_access($user, "watchdog")) { if ($log = db_fetch_object(db_query("SELECT * FROM watchdog WHERE hostname = '". getenv("REMOTE_ADDR") ."' AND level = '". $watchdog[$id][0] ."'"))) { if (time() - $log->timestamp < $watchdog[$id][1]) { @@ -20,7 +21,7 @@ function watchdog($id, $message) { } } - // Perform query to add new watchdog entry: + // perform query to add new watchdog entry: db_query("INSERT INTO watchdog (level, timestamp, user, message, location, hostname) VALUES ('". $watchdog[$id][0] ."', '". time() ."', '". check_input($user->id) ."', '". check_input($message) ."', '". check_input(getenv("REQUEST_URI")) ."', '". check_input(getenv("REMOTE_ADDR")) ."')"); } |