From d9352a1b382008de35457e15b03346e873b3b229 Mon Sep 17 00:00:00 2001 From: francis Date: Mon, 9 Mar 2009 01:17:04 +0000 Subject: Option to ban users. --- app/controllers/user_controller.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'app/controllers/user_controller.rb') diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index a443d3e7d..38ebd076f 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -4,7 +4,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: user_controller.rb,v 1.62 2009-03-05 19:09:47 francis Exp $ +# $Id: user_controller.rb,v 1.63 2009-03-09 01:17:04 francis Exp $ class UserController < ApplicationController # Show page about a user @@ -219,6 +219,13 @@ class UserController < ApplicationController def contact @recipient_user = User.find(params[:id]) + # Banned from messaging users? + if !authenticated_user.nil? && !authenticated_user.can_contact_other_users? + @details = authenticated_user.can_fail_html + render :template => 'user/banned' + return + end + # You *must* be logged into send a message to another user. (This is # partly to avoid spam, and partly to have some equanimity of openess # between the two users) -- cgit v1.2.3