| Class | ResetPasswordsController |
| In: |
app/controllers/reset_passwords_controller.rb
|
| Parent: | ApplicationController |
File reset_passwords_controller.rb Project iboard4 Author Andreas Altendorfer Copyright 2009 by Andreas Altendorfer
There is no model for this controller. When a user wants to reset ones password a mail will be delivered after reseting the perishable_token of AuthLogic
# File app/controllers/reset_passwords_controller.rb, line 21
21: def create
22: @user = User.find_by_email(params[:email])
23: if @user
24: @user.send_later(:deliver_password_reset_instructions,t(:reset_password_instructions_subject))
25: flash[:notice] = t(:password_reset_instructions)
26: redirect_to root_url
27: else
28: flash[:error] = t(:user_not_found_for_password_reset)
29: render :action => :new
30: end
31: end
# File app/controllers/reset_passwords_controller.rb, line 33
33: def update
34: @user.password = params[:user][:password]
35: @user.password_confirmation = params[:user][:password_confirmation]
36: if !@user.password.blank? && @user.save
37: flash[:notice] = t(:password_successfully_updated)
38: redirect_to root_url
39: else
40: flash[:error] = t(:please_enter_your_new_password)
41: render :action => :edit
42: end
43: end