Commit 80fbced2 authored by Pawel Chojnacki's avatar Pawel Chojnacki

Add admin settings entries

parent 5173c093
...@@ -138,6 +138,9 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController ...@@ -138,6 +138,9 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:two_factor_grace_period, :two_factor_grace_period,
:user_default_external, :user_default_external,
:user_oauth_applications, :user_oauth_applications,
:unique_ips_limit_per_user,
:unique_ips_limit_time_window,
:unique_ips_limit_enabled,
:version_check_enabled, :version_check_enabled,
:terminal_max_session_time, :terminal_max_session_time,
......
...@@ -64,6 +64,16 @@ class ApplicationSetting < ActiveRecord::Base ...@@ -64,6 +64,16 @@ class ApplicationSetting < ActiveRecord::Base
presence: true, presence: true,
if: :akismet_enabled if: :akismet_enabled
validates :unique_ips_limit_per_user,
numericality: { greater_than_or_equal_to: 1 },
presence: true,
if: :unique_ips_limit_enabled
validates :unique_ips_limit_time_window,
numericality: { greater_than_or_equal_to: 0 },
presence: true,
if: :unique_ips_limit_enabled
validates :koding_url, validates :koding_url,
presence: true, presence: true,
if: :koding_enabled if: :koding_enabled
......
...@@ -360,6 +360,28 @@ ...@@ -360,6 +360,28 @@
Generate API key at Generate API key at
%a{ href: 'http://www.akismet.com', target: 'blank' } http://www.akismet.com %a{ href: 'http://www.akismet.com', target: 'blank' } http://www.akismet.com
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
= f.label :unique_ips_limit_enabled do
= f.check_box :unique_ips_limit_enabled
Limit sign in from multiple ips
%span.help-block#recaptcha_help_block Helps prevent malicious users hide their activity
.form-group
= f.label :unique_ips_limit_per_user, 'IPs per user', class: 'control-label col-sm-2'
.col-sm-10
= f.number_field :unique_ips_limit_per_user, class: 'form-control'
.help-block
Maximum number of unique IPs per user
.form-group
= f.label :unique_ips_limit_time_window, 'IP expiration time', class: 'control-label col-sm-2'
.col-sm-10
= f.number_field :unique_ips_limit_time_window, class: 'form-control'
.help-block
How long an IP will be counted towards the limit
%fieldset %fieldset
%legend Abuse reports %legend Abuse reports
.form-group .form-group
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment