Improved ldap settings.
This commit is contained in:
parent
21206f2f62
commit
78b73eef43
2 changed files with 36 additions and 9 deletions
|
@ -4,6 +4,7 @@ class LdapSupport < ActiveRecord::Migration
|
||||||
# return if it's a new setup
|
# return if it's a new setup
|
||||||
return if !Setting.find_by(name: 'system_init_done')
|
return if !Setting.find_by(name: 'system_init_done')
|
||||||
|
|
||||||
|
if !ActiveRecord::Base.connection.table_exists? 'import_jobs'
|
||||||
create_table :import_jobs do |t|
|
create_table :import_jobs do |t|
|
||||||
t.string :name, limit: 250, null: false
|
t.string :name, limit: 250, null: false
|
||||||
|
|
||||||
|
@ -17,6 +18,7 @@ class LdapSupport < ActiveRecord::Migration
|
||||||
|
|
||||||
t.timestamps null: false
|
t.timestamps null: false
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
Setting.create_or_update(
|
Setting.create_or_update(
|
||||||
title: 'Authentication via %s',
|
title: 'Authentication via %s',
|
||||||
|
@ -78,7 +80,7 @@ class LdapSupport < ActiveRecord::Migration
|
||||||
|
|
||||||
Scheduler.create_or_update(
|
Scheduler.create_or_update(
|
||||||
name: 'Import Jobs',
|
name: 'Import Jobs',
|
||||||
method: 'ImportJob.start',
|
method: 'ImportJob.start_registered',
|
||||||
period: 1.hour,
|
period: 1.hour,
|
||||||
prio: 1,
|
prio: 1,
|
||||||
active: true,
|
active: true,
|
||||||
|
@ -86,6 +88,19 @@ class LdapSupport < ActiveRecord::Migration
|
||||||
created_by_id: 1
|
created_by_id: 1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Setting.create_if_not_exists(
|
||||||
|
title: 'Import Backends',
|
||||||
|
name: 'import_backends',
|
||||||
|
area: 'Import',
|
||||||
|
description: 'A list of active import backends that get scheduled automatically.',
|
||||||
|
options: {},
|
||||||
|
state: ['Import::Ldap'],
|
||||||
|
preferences: {
|
||||||
|
permission: ['admin'],
|
||||||
|
},
|
||||||
|
frontend: false
|
||||||
|
)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
12
db/seeds.rb
12
db/seeds.rb
|
@ -2072,6 +2072,18 @@ Setting.create_if_not_exists(
|
||||||
state: '',
|
state: '',
|
||||||
frontend: false
|
frontend: false
|
||||||
)
|
)
|
||||||
|
Setting.create_if_not_exists(
|
||||||
|
title: 'Import Backends',
|
||||||
|
name: 'import_backends',
|
||||||
|
area: 'Import',
|
||||||
|
description: 'A list of active import backends that get scheduled automatically.',
|
||||||
|
options: {},
|
||||||
|
state: ['Import::Ldap'],
|
||||||
|
preferences: {
|
||||||
|
permission: ['admin'],
|
||||||
|
},
|
||||||
|
frontend: false
|
||||||
|
)
|
||||||
|
|
||||||
Setting.create_if_not_exists(
|
Setting.create_if_not_exists(
|
||||||
title: 'Time Accounting',
|
title: 'Time Accounting',
|
||||||
|
|
Loading…
Reference in a new issue