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.
 
 
 
 
 

26 lines
790 B

  1. class PasswordResetsController < ApplicationController
  2. def create
  3. @user = User.find_by_email(params[:email])
  4. @user.deliver_reset_password_instructions! if @user
  5. redirect_to(root_path, :notice => "Instructions have been sent to your email.")
  6. end
  7. def edit
  8. @user = User.load_from_reset_password_token(params[:id])
  9. @token = params[:id]
  10. not_authenticated unless @user
  11. end
  12. def update
  13. @token = params[:token]
  14. @user = User.load_from_reset_password_token(params[:token])
  15. not_authenticated unless @user
  16. @user.password_confirmation = params[:user][:password_confirmation]
  17. if @user.change_password!(params[:user][:password])
  18. redirect_to(root_path, :notice => "Password changed OK")
  19. else
  20. render :action => "edit"
  21. end
  22. end
  23. end