GeoRSS aggregator and Layar augmented reality server
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 

26 lignes
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