aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/request_controller.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-01-29 20:23:34 +0000
committerRobin Houston <robin.houston@gmail.com>2012-01-29 20:23:34 +0000
commit500b4d37702cdbad113ccb94c875e90dd770231a (patch)
tree46b2fd44234965ff32725c499571b4c9d2814ec4 /app/controllers/request_controller.rb
parentbbaa789b6c417300fbdace70ca93d7099c68b718 (diff)
Rate limiting
Add the capability to specify a limit to the number of requests a user can make per day, which can be turned off for specific users in the admin interface.
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r--app/controllers/request_controller.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index a70e8d16c..fc1ffdd75 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -208,8 +208,12 @@ class RequestController < ApplicationController
# Banned from making new requests?
if !authenticated_user.nil? && !authenticated_user.can_file_requests?
- @details = authenticated_user.can_fail_html
- render :template => 'user/banned'
+ if authenticated_user.exceeded_limit?
+ render :template => 'user/rate_limited'
+ else
+ @details = authenticated_user.can_fail_html
+ render :template => 'user/banned'
+ end
return
end