From 6112f1de0f052cfa29aded7ef9822cd2fbd4ea6b Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 21 Jun 2016 22:47:50 +0200 Subject: [PATCH] Set password config to frontend: false. --- .../20160621000001_update_setting_password.rb | 155 ++++++++++++++++++ db/seeds.rb | 12 +- 2 files changed, 161 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20160621000001_update_setting_password.rb diff --git a/db/migrate/20160621000001_update_setting_password.rb b/db/migrate/20160621000001_update_setting_password.rb new file mode 100644 index 000000000..e8f267b78 --- /dev/null +++ b/db/migrate/20160621000001_update_setting_password.rb @@ -0,0 +1,155 @@ +class UpdateSettingPassword < ActiveRecord::Migration + def up + # return if it's a new setup + return if !Setting.find_by(name: 'system_init_done') + + Setting.create_or_update( + title: 'Ignore Escalation/SLA Information', + name: 'import_ignore_sla', + area: 'Import::Base', + description: 'Ignore Escalation/SLA Information form import system.', + options: { + form: [ + { + display: '', + null: true, + name: 'import_ignore_sla', + tag: 'boolean', + options: { + true => 'yes', + false => 'no', + }, + }, + ], + }, + state: false, + frontend: false, + ) + Setting.create_or_update( + title: 'Define searchable models.', + name: 'models_searchable', + area: 'Models::Base', + description: 'Define the models which can be searched for.', + options: {}, + state: [], + frontend: true, + ) + Setting.create_or_update( + title: 'Minimal size', + name: 'password_min_size', + area: 'Security::Password', + description: 'Password need to have at least minimal size of characters.', + options: { + form: [ + { + display: '', + null: true, + name: 'password_min_size', + tag: 'select', + options: { + 4 => ' 4', + 5 => ' 5', + 6 => ' 6', + 7 => ' 7', + 8 => ' 8', + 9 => ' 9', + 10 => '10', + 11 => '11', + 12 => '12', + 13 => '13', + 14 => '14', + 15 => '15', + 16 => '16', + 17 => '17', + 18 => '18', + 19 => '19', + 20 => '20', + }, + }, + ], + }, + state: 6, + frontend: false, + ) + Setting.create_or_update( + title: '2 lower and 2 upper characters', + name: 'password_min_2_lower_2_upper_characters', + area: 'Security::Password', + description: 'Password need to contain 2 lower and 2 upper characters.', + options: { + form: [ + { + display: '', + null: true, + name: 'password_min_2_lower_2_upper_characters', + tag: 'select', + options: { + 1 => 'yes', + 0 => 'no', + }, + }, + ], + }, + state: 0, + frontend: false, + ) + Setting.create_or_update( + title: 'Digit required', + name: 'password_need_digit', + area: 'Security::Password', + description: 'Password need to have at least one digit.', + options: { + form: [ + { + display: 'Needed', + null: true, + name: 'password_need_digit', + tag: 'select', + options: { + 1 => 'yes', + 0 => 'no', + }, + }, + ], + }, + state: 1, + frontend: false, + ) + Setting.create_or_update( + title: 'Maximal failed logins', + name: 'password_max_login_failed', + area: 'Security::Password', + description: 'Maximal failed logins after account is inactive.', + options: { + form: [ + { + display: '', + null: true, + name: 'password_max_login_failed', + tag: 'select', + options: { + 4 => ' 4', + 5 => ' 5', + 6 => ' 6', + 7 => ' 7', + 8 => ' 8', + 9 => ' 9', + 10 => '10', + 11 => '11', + 13 => '13', + 14 => '14', + 15 => '15', + 16 => '16', + 17 => '17', + 18 => '18', + 19 => '19', + 20 => '20', + }, + }, + ], + }, + state: 10, + frontend: false, + ) + end +end diff --git a/db/seeds.rb b/db/seeds.rb index 73c451662..3972ee687 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -679,7 +679,7 @@ Setting.create_if_not_exists( ], }, state: 6, - frontend: true + frontend: false ) Setting.create_if_not_exists( title: '2 lower and 2 upper characters', @@ -701,7 +701,7 @@ Setting.create_if_not_exists( ], }, state: 0, - frontend: true + frontend: false ) Setting.create_if_not_exists( title: 'Digit required', @@ -723,7 +723,7 @@ Setting.create_if_not_exists( ], }, state: 1, - frontend: true + frontend: false ) Setting.create_if_not_exists( title: 'Maximal failed logins', @@ -759,7 +759,7 @@ Setting.create_if_not_exists( ], }, state: 10, - frontend: true + frontend: false ) Setting.create_if_not_exists( @@ -1260,7 +1260,7 @@ Setting.create_if_not_exists( description: 'Define the models which can be searched for.', options: {}, state: [], - frontend: false, + frontend: true, ) Setting.create_if_not_exists( @@ -1379,7 +1379,7 @@ Setting.create_if_not_exists( ], }, state: false, - frontend: true + frontend: false ) Setting.create_if_not_exists(