Commit ec7a68a1 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Simplify legacy LDAP config interpretation

parent 8b4705fe
...@@ -66,10 +66,11 @@ Settings.ldap['enabled'] = false if Settings.ldap['enabled'].nil? ...@@ -66,10 +66,11 @@ Settings.ldap['enabled'] = false if Settings.ldap['enabled'].nil?
# backwards compatibility, we only have one host # backwards compatibility, we only have one host
if Settings.ldap['enabled'] || Rails.env.test? if Settings.ldap['enabled'] || Rails.env.test?
if Settings.ldap['host'].present? if Settings.ldap['host'].present?
# We detected old LDAP configuration syntax. Update the config to make it
# look like it was entered with the new syntax.
server = Settings.ldap.except('sync_time') server = Settings.ldap.except('sync_time')
server['provider_name'] = 'ldapmain'
Settings.ldap['servers'] = { Settings.ldap['servers'] = {
'ldap' => server 'main' => server
} }
end end
......
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