From 461bf3802df857c51a4ba8bc08bd311418cf72ed Mon Sep 17 00:00:00 2001 From: Damian Sulewski Date: Sat, 26 May 2007 20:58:33 +0000 Subject: [PATCH] applied TomH patch for lost password site --- app/controllers/user_controller.rb | 4 +++- config/routes.rb | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 64e1e157d..cf1a176f1 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -53,7 +53,7 @@ class UserController < ApplicationController end def lost_password - if params[:user][:email] + if params[:user] and params[:user][:email] user = User.find_by_email(params['user']['email']) if user user.token = User.make_token @@ -63,6 +63,8 @@ class UserController < ApplicationController else flash[:notice] = "Couldn't find that email address, sorry." end + else + render :action => 'lost_password' end end diff --git a/config/routes.rb b/config/routes.rb index 4f887d140..2420de1ca 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -44,6 +44,7 @@ ActionController::Routing::Routes.draw do |map| map.connect '/user/save', :controller => 'user', :action => 'save' map.connect '/user/confirm', :controller => 'user', :action => 'confirm' map.connect '/user/go_public', :controller => 'user', :action => 'go_public' + map.connect '/user/reset_password', :controller => 'user', :action => 'reset_password' map.connect '/index.html', :controller => 'site', :action => 'index' map.connect '/edit.html', :controller => 'site', :action => 'edit' map.connect '/search.html', :controller => 'way_tag', :action => 'search' -- 2.39.5