summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorEric Maziade <eric.maziade@novisoft.com>2015-06-05 11:50:37 -0400
committerEric Maziade <eric.maziade@novisoft.com>2015-06-05 11:50:37 -0400
commit84a414fe534ebb60c8e7396c245486be521e2a11 (patch)
tree35880b0bf1bdd1ba5818bbea464e86c7391f2407 /app
parent971e57cffa6a89ebcd4da83efc4967f834f8f58b (diff)
downloadgitlab-ce-84a414fe534ebb60c8e7396c245486be521e2a11.tar.gz
Add session expiration delay configuration through UI application
settings
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin/application_settings_controller.rb1
-rw-r--r--app/models/application_setting.rb2
-rw-r--r--app/views/admin/application_settings/_form.html.haml4
3 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb
index a01e2a907d7..2601867cf03 100644
--- a/app/controllers/admin/application_settings_controller.rb
+++ b/app/controllers/admin/application_settings_controller.rb
@@ -40,6 +40,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:home_page_url,
:after_sign_out_path,
:max_attachment_size,
+ :session_expire_seconds,
:default_project_visibility,
:default_snippet_visibility,
:restricted_signup_domains_raw,
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb
index 80463ee8841..ce06e022c3d 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -15,6 +15,7 @@
# twitter_sharing_enabled :boolean default(TRUE)
# restricted_visibility_levels :text
# max_attachment_size :integer default(10), not null
+# session_expire_seconds :integer default(604800), not null
# default_project_visibility :integer
# default_snippet_visibility :integer
# restricted_signup_domains :text
@@ -61,6 +62,7 @@ class ApplicationSetting < ActiveRecord::Base
sign_in_text: Settings.extra['sign_in_text'],
restricted_visibility_levels: Settings.gitlab['restricted_visibility_levels'],
max_attachment_size: Settings.gitlab['max_attachment_size'],
+ session_expire_seconds: Settings.gitlab['session_expire_seconds'],
default_project_visibility: Settings.gitlab.default_projects_features['visibility_level'],
default_snippet_visibility: Settings.gitlab.default_projects_features['visibility_level'],
restricted_signup_domains: Settings.gitlab['restricted_signup_domains']
diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml
index 188a08940ab..9de29e50d15 100644
--- a/app/views/admin/application_settings/_form.html.haml
+++ b/app/views/admin/application_settings/_form.html.haml
@@ -84,6 +84,10 @@
.col-sm-10
= f.number_field :max_attachment_size, class: 'form-control'
.form-group
+ = f.label :session_expire_seconds, 'Session duration (seconds)', class: 'control-label col-sm-2'
+ .col-sm-10
+ = f.number_field :session_expire_seconds, class: 'form-control'
+ .form-group
= f.label :restricted_signup_domains, 'Restricted domains for sign-ups', class: 'control-label col-sm-2'
.col-sm-10
= f.text_area :restricted_signup_domains_raw, placeholder: 'domain.com', class: 'form-control'