X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/846699104d2783d2d9d1162196bd428f0af6334e..c6077fd124c79559e45174f8e5df9ba4a1d09bc3:/app/controllers/user_controller.rb diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 3a2bc7f0d..430e56cb0 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -67,7 +67,12 @@ class UserController < ApplicationController flash.now[:notice] = t 'user.account.flash update success' else flash.now[:notice] = t 'user.account.flash update success confirm needed' - Notifier.deliver_email_confirm(@user, @user.tokens.create) + + begin + Notifier.deliver_email_confirm(@user, @user.tokens.create) + rescue + # Ignore errors sending email + end end end else @@ -107,7 +112,8 @@ class UserController < ApplicationController if user token = user.tokens.create Notifier.deliver_lost_password(user, token) - flash.now[:notice] = t 'user.lost_password.notice email on way' + flash[:notice] = t 'user.lost_password.notice email on way' + redirect_to :action => 'login' else flash.now[:error] = t 'user.lost_password.notice email cannot find' end @@ -157,6 +163,7 @@ class UserController < ApplicationController user = User.authenticate(:username => email_or_display_name, :password => pass) if user session[:user] = user.id + session_expires_after 1.month if params[:remember_me] elsif User.authenticate(:username => email_or_display_name, :password => pass, :inactive => true) flash.now[:error] = t 'user.login.account not active' else @@ -192,6 +199,7 @@ class UserController < ApplicationController session[:token] = nil end session[:user] = nil + session_expires_automatically if params[:referer] redirect_to params[:referer] else