Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
80fbced2
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
80fbced2
编写于
2月 17, 2017
作者:
P
Pawel Chojnacki
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add admin settings entries
上级
5173c093
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
35 addition
and
0 deletion
+35
-0
app/controllers/admin/application_settings_controller.rb
app/controllers/admin/application_settings_controller.rb
+3
-0
app/models/application_setting.rb
app/models/application_setting.rb
+10
-0
app/views/admin/application_settings/_form.html.haml
app/views/admin/application_settings/_form.html.haml
+22
-0
未找到文件。
app/controllers/admin/application_settings_controller.rb
浏览文件 @
80fbced2
...
...
@@ -138,6 +138,9 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:two_factor_grace_period
,
:user_default_external
,
:user_oauth_applications
,
:unique_ips_limit_per_user
,
:unique_ips_limit_time_window
,
:unique_ips_limit_enabled
,
:version_check_enabled
,
:terminal_max_session_time
,
...
...
app/models/application_setting.rb
浏览文件 @
80fbced2
...
...
@@ -64,6 +64,16 @@ class ApplicationSetting < ActiveRecord::Base
presence:
true
,
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
,
presence:
true
,
if: :koding_enabled
...
...
app/views/admin/application_settings/_form.html.haml
浏览文件 @
80fbced2
...
...
@@ -360,6 +360,28 @@
Generate API key at
%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
%legend
Abuse reports
.form-group
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录