summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-09-13 10:35:46 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-09-13 10:35:46 +0000
commit77b0abb79cb81ae1f4bbbe3c2e5a2f78631b09a8 (patch)
treea1440e8854eb401d0eb1ae403d53926dea444064 /app/controllers
parente124da5488291dc10fab0d17ebbf54b7f70b436b (diff)
downloadredmine-77b0abb79cb81ae1f4bbbe3c2e5a2f78631b09a8.tar.gz
redmine-77b0abb79cb81ae1f4bbbe3c2e5a2f78631b09a8.zip
Fixed: The error flash message on session expiration is not in the language of the user but of the user of the previous request (#17023).
git-svn-id: http://svn.redmine.org/redmine/trunk@13391 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/application_controller.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 10e0ecbb2..e70f1602c 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -61,6 +61,7 @@ class ApplicationController < ActionController::Base
def session_expiration
if session[:user_id]
if session_expired? && !try_to_autologin
+ set_localization(User.active.find_by_id(session[:user_id]))
reset_session
flash[:error] = l(:error_session_expired)
redirect_to signin_url
@@ -197,10 +198,10 @@ class ApplicationController < ActionController::Base
end
end
- def set_localization
+ def set_localization(user=User.current)
lang = nil
- if User.current.logged?
- lang = find_language(User.current.language)
+ if user && user.logged?
+ lang = find_language(user.language)
end
if lang.nil? && !Setting.force_default_language_for_anonymous? && request.env['HTTP_ACCEPT_LANGUAGE']
accept_lang = parse_qvalues(request.env['HTTP_ACCEPT_LANGUAGE']).first