summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-07-28 09:13:50 +0000
committerDouwe Maan <douwe@gitlab.com>2017-07-28 09:13:50 +0000
commitda3100254f446bcb1f27516606f25d92893f81b8 (patch)
tree1c6346cfd7b0ad057b722b6f694bfd738b5b3fbc /config
parent190fae5f0cef11d68c7385be0c4013931796f958 (diff)
parentef97cb54ae3c62e8bc9062c7f32901520865d754 (diff)
downloadgitlab-ce-da3100254f446bcb1f27516606f25d92893f81b8.tar.gz
Merge branch 'backport-2844-ldap-ee-license-checks' into 'master'
Backport some recent changes related to LDAP from EE See merge request !13119
Diffstat (limited to 'config')
-rw-r--r--config/initializers/omniauth.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb
index a36e59c941a..56c279ffcf4 100644
--- a/config/initializers/omniauth.rb
+++ b/config/initializers/omniauth.rb
@@ -1,13 +1,16 @@
if Gitlab::LDAP::Config.enabled?
module OmniAuth::Strategies
- server = Gitlab.config.ldap.servers.values.first
- klass = server['provider_class']
- const_set(klass, Class.new(LDAP)) unless klass == 'LDAP'
+ Gitlab::LDAP::Config.available_servers.each do |server|
+ # do not redeclare LDAP
+ next if server['provider_name'] == 'ldap'
+ const_set(server['provider_class'], Class.new(LDAP))
+ end
end
OmniauthCallbacksController.class_eval do
- server = Gitlab.config.ldap.servers.values.first
- alias_method server['provider_name'], :ldap
+ Gitlab::LDAP::Config.available_servers.each do |server|
+ alias_method server['provider_name'], :ldap
+ end
end
end