]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Merge branch 'master' into openid
[rails.git] / app / controllers / application_controller.rb
index 0c41170470c3d9b1054be5cb8e4c61a55e3a3b77..a53fb5374b06d02415ff8c0285590388e344398a 100644 (file)
@@ -8,7 +8,14 @@ class ApplicationController < ActionController::Base
 
   def authorize_web
     if session[:user]
 
   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
     elsif session[:token]
       @user = User.authenticate(:token => session[:token])
       session[:user] = @user.id