X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/2df3a8d2e25460b1eef06c9189f2677833cbdcac..155ed85bf5b90fc0419289354904a3f9945dda3f:/app/controllers/application_controller.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0c4117047..a53fb5374 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -8,7 +8,14 @@ class ApplicationController < ActionController::Base def authorize_web if session[:user] - @user = User.find(session[:user], :conditions => {:visible => true}) + @user = User.find(session[:user], :conditions => {:status => ["active", "confirmed", "suspended"]}) + + if @user.status == "suspended" + session[:user] = nil + session_expires_automatically + + redirect_to :controller => "user", :action => "suspended" + end elsif session[:token] @user = User.authenticate(:token => session[:token]) session[:user] = @user.id