Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #####LOGIN CONTROLLER (part of it)#######
- def send_password_via_email
- unless User.find_by_email(params[:email]).nil?
- user = User.find_by_email(params[:email])
- user.hashed_password = user.object_id.to_s + rand.to_s.slice(2, rand.to_s.length)
- user.save!
- Notifier.deliver_password_recovery(user)
- flash[:notice] = "A new password has been sent to your e-mail."
- redirect_to(:action => "login")
- end
- end
Add Comment
Please, Sign In to add comment