X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/8b240b982b0c0c1f786054f0c472353cb2e85d10..d27ff25473285a8f1b2458285b3ca0c95d401fa5:/app/controllers/user_controller.rb diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 0c10980ef..83845af42 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -74,6 +74,8 @@ class UserController < ApplicationController if user pass = User.make_token(8) user.pass_crypt = pass + user.pass_crypt_confirmation = pass + user.active = true user.save Notifier::deliver_reset_password(user, pass) flash[:notice] = "Your password has been changed and is on its way to your mailbox :-)" @@ -97,8 +99,8 @@ class UserController < ApplicationController u.timeout = 1.day.from_now u.save session[:token] = u.token - if params[:next_controller] and params[:next_action] - redirect_to :controller => params[:next_controller], :action => params[:next_action] + if params[:referer] + redirect_to params[:referer] else redirect_to :controller => 'site', :action => 'index' end @@ -119,8 +121,8 @@ class UserController < ApplicationController end end session[:token] = nil - if params[:next_controller] and params[:next_action] - redirect_to :controller => params[:next_controller], :action => params[:next_action] + if params[:referer] + redirect_to params[:referer] else redirect_to :controller => 'site', :action => 'index' end