Sha256: 9a0d7d0f6c971fe9cf0cef7bd367726c6566e2ecf42ebc7606d8145157ad927c

Contents?: true

Size: 884 Bytes

Versions: 73

Compression:

Stored size: 884 Bytes

Contents

class PasswordResetsController < ApplicationController

  def create
    ##user = User.find_by_email(params[:email])
    user = User.where(:email => params[:email]).first

    user.send_password_reset if user
    redirect_to root_url, :notice => "Email sent with password reset instructions."
  end

  def edit
    ##@user = User.find_by_password_reset_token!(params[:id])
    @user = User.where(:password_reset_token => params[:id]).first
  end

  def update
    ##@user = User.find_by_password_reset_token!(params[:id])
    @user = User.where(:password_reset_token => params[:id]).first
    if @user.password_reset_sent_at < 2.hours.ago
      redirect_to new_password_reset_path, :alert => "Password reset has expired."
    elsif @user.update_attributes(params[:user])
      redirect_to root_url, :notice => "Password has been reset!"
    else
      render :edit
    end
  end
end

Version data entries

73 entries across 70 versions & 3 rubygems

Version Path
jinda-0.5.2 lib/generators/jinda/templates/app/controllers/jinda_org/password_resets.rb
jinda-0.5.1 lib/generators/jinda/templates/app/controllers/jinda_org/password_resets.rb
jinda-0.5.0 lib/generators/jinda/templates/app/controllers/jinda_org/password_resets.rb
jinda-0.4.9 lib/generators/jinda/templates/app/controllers/jinda_org/password_resets.rb
jinda-0.4.8 lib/generators/jinda/templates/app/controllers/jinda_org/password_resets.rb
jinda-0.4.7 lib/generators/jinda/templates/app/controllers/jinda_org/password_resets.rb
jinda-0.4.6 lib/generators/jinda/templates/app/controllers/jinda_org/password_resets.rb
jinda-5-0.4.5 lib/generators/jinda/templates/app/controllers/jinda_org/password_resets.rb
jinda-0.4.5 lib/generators/jinda/templates/app/controllers/jinda_org/password_resets.rb
jinda-0.4.4 lib/generators/jinda/templates/app/controllers/jinda_org/password_resets.rb
jinda-0.3.3 lib/generators/jinda/templates/app/controllers/password_resets.rb
jinda-0.3.2 lib/generators/jinda/templates/app/controllers/password_resets.rb
jinda-0.3.1 lib/generators/jinda/templates/app/controllers/password_resets.rb
jinda-0.3.0 lib/generators/jinda/templates/app/controllers/password_resets.rb
jinda-0.2.9 lib/generators/jinda/templates/app/controllers/password_resets.rb
jinda-0.2.8 lib/generators/jinda/templates/app/controllers/password_resets.rb
jinda-0.2.7 lib/generators/jinda/templates/app/controllers/password_resets.rb
jinda-0.2.6 lib/generators/jinda/templates/app/controllers/password_resets.rb
jinda-0.2.5 lib/generators/jinda/templates/app/controllers/password_resets.rb
jinda-0.2.4 lib/generators/jinda/templates/app/controllers/password_resets.rb