X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/2df3a8d2e25460b1eef06c9189f2677833cbdcac..ebd109c946d71b3ccc616ea3966e56ae019638d7:/app/controllers/application_controller.rb?ds=inline 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