]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Rework the login method to make it a bit clearer
[rails.git] / app / controllers / application_controller.rb
index eebc9eb2826f8c86a72932997b2dce9773f4072e..a53fb5374b06d02415ff8c0285590388e344398a 100644 (file)
@@ -8,7 +8,14 @@ class ApplicationController < ActionController::Base
 
   def authorize_web
     if session[:user]
-      @user = User.find(session[:user], :conditions => {:status => ["active", "confirmed"]})
+      @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