diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 096eddf97..011be3171 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -42,7 +42,7 @@ class ApplicationController < ActionController::Base end before_filter :session_expiration, :user_setup, :check_if_login_required, :set_localization - + before_filter :user_agent rescue_from ActionController::InvalidAuthenticityToken, :with => :invalid_authenticity_token rescue_from ::Unauthorized, :with => :deny_access @@ -51,7 +51,10 @@ class ApplicationController < ActionController::Base include Redmine::Search::Controller include Redmine::MenuManager::MenuController helper Redmine::MenuManager::MenuHelper - + + def user_agent + logger.info "HTTP_USER_AGENT #{request.env["HTTP_USER_AGENT"]}" + end def session_expiration if session[:user_id] @@ -65,6 +68,7 @@ class ApplicationController < ActionController::Base end end + def session_expired? if Setting.session_lifetime? unless session[:ctime] && (Time.now.utc.to_i - session[:ctime].to_i <= Setting.session_lifetime.to_i * 60)