]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user.rb
Tell users their account has been suspended when they try and login
[rails.git] / app / models / user.rb
index 23e95bc8803e3a1469ce58cefdd57a1990746069..31b0f27a03428ef9223b3c00bfe05bd89504c27f 100644 (file)
@@ -56,8 +56,11 @@ class User < ActiveRecord::Base
       user = token.user if token
     end
 
-    if user
-      user = nil unless user.visible? and (user.active? or options[:inactive])
+    if user and
+      ( user.status == "deleted" or
+        ( user.status == "pending" and not options[:pending] ) or
+        ( user.status == "suspended" and not options[:suspended] ) )
+      user = nil
     end
 
     token.update_attribute(:expiry, 1.week.from_now) if token and user