diff options
author | Rubén Dávila <ruben@gitlab.com> | 2017-07-26 18:12:20 -0500 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2017-07-27 08:45:16 -0500 |
commit | ef97cb54ae3c62e8bc9062c7f32901520865d754 (patch) | |
tree | c5dcd347bbc9ab20105984637433f089ab4ee9fc /config | |
parent | 4eebd8e1957a3fc3a3479331fde9f34aa8afa9d5 (diff) | |
download | gitlab-ce-ef97cb54ae3c62e8bc9062c7f32901520865d754.tar.gz |
Backport some recent changes related to LDAP from EEbackport-2844-ldap-ee-license-checks
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/omniauth.rb | 13 |
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 |