summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-03-01 19:45:33 +0000
committerDries Buytaert <dries@buytaert.net>2004-03-01 19:45:33 +0000
commit0f980c24bc2ad8fb524df69705b47753aa7bdbfa (patch)
tree458de463ed94371143bfa5431b8bf6a60c4616fe
parentf69425961cb66aeb85b026a06f144e45a85c76ac (diff)
downloadbrdo-0f980c24bc2ad8fb524df69705b47753aa7bdbfa.tar.gz
brdo-0f980c24bc2ad8fb524df69705b47753aa7bdbfa.tar.bz2
- Removed broken throttle.
-rw-r--r--includes/common.inc12
-rw-r--r--modules/comment.module7
-rw-r--r--modules/comment/comment.module7
-rw-r--r--modules/node.module8
-rw-r--r--modules/node/node.module8
-rw-r--r--modules/system.module8
-rw-r--r--modules/system/system.module8
7 files changed, 0 insertions, 58 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 1d199b209..8a1a4eb93 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -404,15 +404,6 @@ function error_handler($errno, $message, $filename, $line, $variables) {
}
}
-function throttle($type, $rate) {
- if (!user_access("access administration pages")) {
- if ($throttle = db_fetch_object(db_query("SELECT * FROM {watchdog} WHERE type = '%s' AND hostname = '%s' AND %d - timestamp < %d", $type, $_SERVER['REMOTE_ADDR'], time(), $rate))) {
- watchdog("warning", "throttle: '". $_SERVER['REMOTE_ADDR'] ."' exceeded submission rate - $throttle->type");
- die(message_throttle());
- }
- }
-}
-
function _fix_gpc_magic(&$item, $key) {
if (is_array($item)) {
array_walk($item, '_fix_gpc_magic');
@@ -482,9 +473,6 @@ function message_na() {
return t("n/a");
}
-function message_throttle() {
- return t("You exceeded the maximum submission rate. Please wait a few minutes and try again.");
-}
/* @} */
function locale_init() {
diff --git a/modules/comment.module b/modules/comment.module
index 2917be5ec..69fd729fb 100644
--- a/modules/comment.module
+++ b/modules/comment.module
@@ -331,13 +331,6 @@ function comment_post($edit) {
}
else {
/*
- ** Check the user's comment submission rate. If exceeded,
- ** throttle() will bail out.
- */
-
- throttle("post comment", variable_get("max_comment_rate", 60));
-
- /*
** Add the comment to database:
*/
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 2917be5ec..69fd729fb 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -331,13 +331,6 @@ function comment_post($edit) {
}
else {
/*
- ** Check the user's comment submission rate. If exceeded,
- ** throttle() will bail out.
- */
-
- throttle("post comment", variable_get("max_comment_rate", 60));
-
- /*
** Add the comment to database:
*/
diff --git a/modules/node.module b/modules/node.module
index 483cf564e..c822c7b1d 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -1427,14 +1427,6 @@ function node_submit($node) {
*/
if (node_access('create', $node)) {
-
- /*
- ** Verify a user's submission rate and avoid duplicate nodes being
- ** inserted:
- */
-
- throttle('node', variable_get('max_node_rate', 900));
-
$node->nid = node_save($node);
watchdog('special', "$node->type: added '$node->title'", l(t('view post'), "node/view/$node->nid"));
$msg = t('your %name was created.', array ('%name' => node_invoke($node, 'node_name')));
diff --git a/modules/node/node.module b/modules/node/node.module
index 483cf564e..c822c7b1d 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1427,14 +1427,6 @@ function node_submit($node) {
*/
if (node_access('create', $node)) {
-
- /*
- ** Verify a user's submission rate and avoid duplicate nodes being
- ** inserted:
- */
-
- throttle('node', variable_get('max_node_rate', 900));
-
$node->nid = node_save($node);
watchdog('special', "$node->type: added '$node->title'", l(t('view post'), "node/view/$node->nid"));
$msg = t('your %name was created.', array ('%name' => node_invoke($node, 'node_name')));
diff --git a/modules/system.module b/modules/system.module
index 6b1e79621..046920158 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -133,15 +133,7 @@ function system_view_general() {
$group .= form_radios(t('Download method'), 'file_downloads', variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC), array(FILE_DOWNLOADS_PUBLIC => t('Public - files are available using http directly.'), FILE_DOWNLOADS_PRIVATE => t('Private - files are be transferred by Drupal.')), t('This setting can be changed at any time, however, all download URLs will change and there may be unexpected problems so it is not recommended.'));
$output .= form_group(t('File system'), $group);
- // submission settings:
- $rate = array(-10000 => t("Disabled"), 1 => t("Maximum 1 every second"), 5 => t("Maximum 1 every 5 seconds"), 15 => t("Maximum 1 every 15 seconds"), 30 => t("Maximum 1 every 30 seconds"), 60 => t("Maximum 1 every minute"), 300 => t("Maximum 1 every 5 minutes"), 900 => t("Maximum 1 every 15 minutes"), 1800 => t("Maximum 1 every 30 minutes"), 3600 => t("Maximum 1 every hour"), 21600 => t("Maximum 1 every 6 hours"), 43200 => t("Maximum 1 every 12 hours"));
- $group = form_select(t("Maximum node rate"), "max_node_rate", variable_get("max_node_rate", 900), $rate, t("The maximum submission rate for nodes. Its purpose is to stop potential abuse or denial of service attacks."));
- $group .= form_select(t("Maximum comment rate"), "max_comment_rate", variable_get("max_comment_rate", 120), $rate, t("The maximum submission rate for comments. Its purpose is to stop potential abuse or denial of service attacks."));
-
- $output .= form_group(t("Submission settings"), $group);
-
// date settings:
-
$timestamp = time();
$zonelist = array(-11, -10, -9.5, -9, -8, -7, -6, -5, -4, -3.5, -3, -2, -1, 0, 1, 2, 3, 3.5, 4, 5, 5.5, 5.75, 6, 6.5, 7, 8, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 14);
foreach ($zonelist as $offset) {
diff --git a/modules/system/system.module b/modules/system/system.module
index 6b1e79621..046920158 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -133,15 +133,7 @@ function system_view_general() {
$group .= form_radios(t('Download method'), 'file_downloads', variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC), array(FILE_DOWNLOADS_PUBLIC => t('Public - files are available using http directly.'), FILE_DOWNLOADS_PRIVATE => t('Private - files are be transferred by Drupal.')), t('This setting can be changed at any time, however, all download URLs will change and there may be unexpected problems so it is not recommended.'));
$output .= form_group(t('File system'), $group);
- // submission settings:
- $rate = array(-10000 => t("Disabled"), 1 => t("Maximum 1 every second"), 5 => t("Maximum 1 every 5 seconds"), 15 => t("Maximum 1 every 15 seconds"), 30 => t("Maximum 1 every 30 seconds"), 60 => t("Maximum 1 every minute"), 300 => t("Maximum 1 every 5 minutes"), 900 => t("Maximum 1 every 15 minutes"), 1800 => t("Maximum 1 every 30 minutes"), 3600 => t("Maximum 1 every hour"), 21600 => t("Maximum 1 every 6 hours"), 43200 => t("Maximum 1 every 12 hours"));
- $group = form_select(t("Maximum node rate"), "max_node_rate", variable_get("max_node_rate", 900), $rate, t("The maximum submission rate for nodes. Its purpose is to stop potential abuse or denial of service attacks."));
- $group .= form_select(t("Maximum comment rate"), "max_comment_rate", variable_get("max_comment_rate", 120), $rate, t("The maximum submission rate for comments. Its purpose is to stop potential abuse or denial of service attacks."));
-
- $output .= form_group(t("Submission settings"), $group);
-
// date settings:
-
$timestamp = time();
$zonelist = array(-11, -10, -9.5, -9, -8, -7, -6, -5, -4, -3.5, -3, -2, -1, 0, 1, 2, 3, 3.5, 4, 5, 5.5, 5.75, 6, 6.5, 7, 8, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 14);
foreach ($zonelist as $offset) {