diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-04-11 17:56:45 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-04-11 17:56:45 +0300 |
commit | 8666f497ff13c100f6cd2339971e430dbf05470f (patch) | |
tree | ac54df95998d2f9d67764171ad29255af5d1b532 /config | |
parent | 24d139ba971cf61a4b7a01031c4c57bcba29b172 (diff) | |
download | gitlab-ce-8666f497ff13c100f6cd2339971e430dbf05470f.tar.gz |
fix ldap identities
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/1_settings.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index e6b00c531ac..c25c799d8f6 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -67,7 +67,7 @@ Settings.ldap['enabled'] = false if Settings.ldap['enabled'].nil? if Settings.ldap['enabled'] || Rails.env.test? if Settings.ldap['host'].present? server = Settings.ldap.except('sync_time') - server['provider_name'] = 'ldap' + server['provider_name'] = 'ldapmain' Settings.ldap['servers'] = { 'ldap' => server } @@ -80,8 +80,13 @@ if Settings.ldap['enabled'] || Rails.env.test? server['provider_name'] ||= "ldap#{key}".downcase server['provider_class'] = OmniAuth::Utils.camelize(server['provider_name']) end + + unless Settings.ldap['servers'].select{ |k, server| server['provider_name'] == "ldapmain"}.any? + raise "Wrong LDAP configuration. The 'main' LDAP section is missing" + end end + Settings['omniauth'] ||= Settingslogic.new({}) Settings.omniauth['enabled'] = false if Settings.omniauth['enabled'].nil? Settings.omniauth['providers'] ||= [] |