]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_controller.rb
applied TomH patch for lost password site
[rails.git] / app / controllers / user_controller.rb
index 64e1e157de48085970360f2b2a6972e1ae065e68..cf1a176f1f6be64b081f66fbc3d30c446fb02986 100644 (file)
@@ -53,7 +53,7 @@ class UserController < ApplicationController
   end
 
   def lost_password
   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
       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
         flash[:notice] = "Couldn't find that email address, sorry."
       end
+    else
+      render :action => 'lost_password'
     end
   end
 
     end
   end