diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-01-29 20:23:34 +0000 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-01-29 20:23:34 +0000 |
commit | 500b4d37702cdbad113ccb94c875e90dd770231a (patch) | |
tree | 46b2fd44234965ff32725c499571b4c9d2814ec4 /app/controllers/request_controller.rb | |
parent | bbaa789b6c417300fbdace70ca93d7099c68b718 (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.rb | 8 |
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 |