Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def self.login(email, password)
- hashed_password = hash_password(password || "")
- @user = find(:first, :conditions => ["email = ? and hashed_password = ?", email, hashed_password])
- @user.datelastlogin = DateTime.now
- @user.save
- @user
- end
- def try_to_login
- User.login(self.email, self.password)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement