GeoRSS aggregator and Layar augmented reality server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

34 line
998 B

  1. class PasswordResetsController < ApplicationController
  2. # before_filter :require_no_user
  3. def create
  4. @user = User.find_by_email(params[:email])
  5. if @user
  6. unless @user.deliver_reset_password_instructions!
  7. redirect_to(root_path, :notice => "Please wait a while before requesting another password reset.")
  8. return
  9. end
  10. end
  11. redirect_to(new_password_reset_path, :notice => "Instructions have been sent to your email.")
  12. end
  13. def edit
  14. @user = User.load_from_reset_password_token(params[:id])
  15. @token = params[:id]
  16. not_authenticated unless @user
  17. end
  18. def update
  19. @token = params[:token]
  20. @user = User.load_from_reset_password_token(params[:token])
  21. not_authenticated unless @user
  22. @user.password_confirmation = params[:user][:password_confirmation]
  23. if @user.change_password!(params[:user][:password])
  24. redirect_to(root_path, :notice => "Password changed OK")
  25. else
  26. render :action => "edit"
  27. end
  28. end
  29. end