aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/comment_controller.rb
diff options
context:
space:
mode:
authorfrancis <francis>2009-03-09 01:17:04 +0000
committerfrancis <francis>2009-03-09 01:17:04 +0000
commitd9352a1b382008de35457e15b03346e873b3b229 (patch)
tree27e07c75f6cf53764f6e615ae9759a6765223064 /app/controllers/comment_controller.rb
parent0ba2aca33b78803d5bc86dae4ea2dbf2322a95fc (diff)
Option to ban users.
Diffstat (limited to 'app/controllers/comment_controller.rb')
-rw-r--r--app/controllers/comment_controller.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/comment_controller.rb b/app/controllers/comment_controller.rb
index 26c475569..dfa31f9ef 100644
--- a/app/controllers/comment_controller.rb
+++ b/app/controllers/comment_controller.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: comment_controller.rb,v 1.8 2008-11-17 17:08:33 francis Exp $
+# $Id: comment_controller.rb,v 1.9 2009-03-09 01:17:04 francis Exp $
class CommentController < ApplicationController
@@ -22,6 +22,13 @@ class CommentController < ApplicationController
raise "Unknown type " + params[:type]
end
+ # Banned from adding comments?
+ if !authenticated_user.nil? && !authenticated_user.can_make_comments?
+ @details = authenticated_user.can_fail_html
+ render :template => 'user/banned'
+ return
+ end
+
if params[:comment]
# XXX this check should theoretically be a validation rule in the model
@existing_comment = Comment.find_by_existing_comment(@info_request.id, params[:comment][:body])