GeoRSS aggregator and Layar augmented reality server
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 

34 linhas
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