]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/user.rb
Use a view to build the trace RSS feed and get rid of OSM::GeoRSS
[rails.git] / app / models / user.rb
index 4c51089e61b4387e7545e5f13af61f35885f65a9..b8ec9aebcb2a95f40ef630eeaddc3ca9fddd46dd 100644 (file)
@@ -70,7 +70,14 @@ class User < ActiveRecord::Base
         end
       end
 
-      user = nil if user and not PasswordHash.check(user.pass_crypt, user.pass_salt, options[:password])
+      if user and PasswordHash.check(user.pass_crypt, user.pass_salt, options[:password])
+        if PasswordHash.upgrade?(user.pass_crypt, user.pass_salt)
+          user.pass_crypt, user.pass_salt = PasswordHash.create(options[:password])
+          user.save
+        end
+      else
+        user = nil
+      end
     elsif options[:token]
       token = UserToken.find_by_token(options[:token])
       user = token.user if token