Added User.uses_deprecated_password? method

This commit is contained in:
Jan Stępień 2011-09-05 01:10:47 +02:00
parent 34e0573fc4
commit 8e23d11054
2 changed files with 18 additions and 0 deletions

View file

@ -211,6 +211,11 @@ class User < ActiveRecord::Base
save(false)
end
# Returns true if the user has a password hashed using SHA-1.
def uses_deprecated_password?
crypted_password =~ /^[a-f0-9]{40}$/i
end
protected
def self.salted(s)