summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-04-11 17:56:45 +0300
committerValery Sizov <vsv2711@gmail.com>2015-04-11 17:56:45 +0300
commit8666f497ff13c100f6cd2339971e430dbf05470f (patch)
treeac54df95998d2f9d67764171ad29255af5d1b532 /config
parent24d139ba971cf61a4b7a01031c4c57bcba29b172 (diff)
downloadgitlab-ce-8666f497ff13c100f6cd2339971e430dbf05470f.tar.gz
fix ldap identities
Diffstat (limited to 'config')
-rw-r--r--config/initializers/1_settings.rb7
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'] ||= []