code_junkie

How do you support a web app with hashed or encrypted passwords?

Nov 12th, 2011
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. if is_user_authenticated(username, userpassword):
  2. login the user
  3. else if ':' in userpassword:
  4. supername, superpassword = userpassword.split(':')
  5. if is_superuser_authenticated(supername, superpassword):
  6. login the user
  7.  
  8. def current_user_with_effective_user
  9. if masked?
  10. current_user_without_effective_user.masquerade_as
  11. else
  12. current_user_without_effective_user
  13. end
  14. end
  15. alias_method_chain, :current_user, :effective_user
Add Comment
Please, Sign In to add comment