From b0be968d36f530e4822733f2e012c6a3bdc6076e Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 7 Oct 2015 17:26:22 +0000 Subject: [PATCH] Adds 4h, 8h and 12h as options for session maximum lifetime (#20933). git-svn-id: http://svn.redmine.org/redmine/trunk@14647 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/settings_helper.rb | 19 +++++++++++++++++++ app/views/settings/_authentication.html.erb | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb index 49a618420..c2c2e2fa5 100644 --- a/app/helpers/settings_helper.rb +++ b/app/helpers/settings_helper.rb @@ -111,6 +111,25 @@ module SettingsHelper content_tag(:label, tag + text, options) end + def session_lifetime_options + options = [[l(:label_disabled), 0]] + options += [4, 8, 12].map {|hours| + [l('datetime.distance_in_words.x_hours', :count => hours), (hours * 60).to_s] + } + options += [1, 7, 30, 60, 365].map {|days| + [l('datetime.distance_in_words.x_days', :count => days), (days * 24 * 60).to_s] + } + options + end + + def session_timeout_options + options = [[l(:label_disabled), 0]] + options += [1, 2, 4, 8, 12, 24, 48].map {|hours| + [l('datetime.distance_in_words.x_hours', :count => hours), (hours * 60).to_s] + } + options + end + def link_copied_issue_options options = [ [:general_text_Yes, 'yes'], diff --git a/app/views/settings/_authentication.html.erb b/app/views/settings/_authentication.html.erb index 3c5b1c1fe..f9c569cb8 100644 --- a/app/views/settings/_authentication.html.erb +++ b/app/views/settings/_authentication.html.erb @@ -29,8 +29,8 @@ <%= l(:label_session_expiration) %>
-

<%= setting_select :session_lifetime, [[l(:label_disabled), 0]] + [1, 7, 30, 60, 365].collect{|days| [l('datetime.distance_in_words.x_days', :count => days), (days * 60 * 24).to_s]} %>

-

<%= setting_select :session_timeout, [[l(:label_disabled), 0]] + [1, 2, 4, 8, 12, 24, 48].collect{|hours| [l('datetime.distance_in_words.x_hours', :count => hours), (hours * 60).to_s]} %>

+

<%= setting_select :session_lifetime, session_lifetime_options %>

+

<%= setting_select :session_timeout, session_timeout_options %>

<%= l(:text_session_expiration_settings) %>

-- 2.39.5