aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/user_controller.rb
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2015-02-18 15:37:11 +0000
committerGareth Rees <gareth@mysociety.org>2015-02-24 13:23:18 +0000
commitd8b9ea8bfe9fdf534504044774f0dcdb4bba20f2 (patch)
tree1412a43c70b0ef6a2a245953d5b4583297ce65ab /app/controllers/user_controller.rb
parent8341ff286c42cc09dfd56d3f76521375ee4d0219 (diff)
Fully prevent banned users editing their photo
Diffstat (limited to 'app/controllers/user_controller.rb')
-rw-r--r--app/controllers/user_controller.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
index 32b6978ea..d66b4aa8e 100644
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/user_controller.rb
@@ -460,6 +460,12 @@ class UserController < ApplicationController
return
end
if !params[:submitted_draft_profile_photo].nil?
+ if @user.banned?
+ flash[:error]= _('Banned users cannot edit their profile')
+ redirect_to set_profile_photo_path
+ return
+ end
+
# check for uploaded image
file_name = nil
file_content = nil