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.

password_resets_controller.rb 998 B

123456789101112131415161718192021222324252627282930313233
  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