summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@gitlab.com>2014-10-20 09:38:40 +0000
committerDmitriy Zaporozhets <dzaporozhets@gitlab.com>2014-10-20 09:38:40 +0000
commitc4d487a7ef5bfaf2ad57f70f39abaa8994db9a74 (patch)
tree2a3da3a688a955fd50ffbe4ed4346b7d143334cd
parentc5360a588d4e8a27322dd1eb6cee0e563c32788c (diff)
parent61d9d4e2eb2a51243276422d901b158abbb2f0da (diff)
downloadgitlab-ce-c4d487a7ef5bfaf2ad57f70f39abaa8994db9a74.tar.gz
Merge branch 'ldap-fixes' into 'master'
Ldap fixes Solves #1688 and #1686 See merge request !1193
-rw-r--r--config/initializers/1_settings.rb2
-rw-r--r--config/initializers/7_omniauth.rb3
2 files changed, 3 insertions, 2 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index 7e7c91ced77..88cbaefea7d 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -61,7 +61,6 @@ 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['label'] = 'LDAP'
server['provider_name'] = 'ldap'
Settings.ldap['servers'] = {
'ldap' => server
@@ -69,6 +68,7 @@ if Settings.ldap['enabled'] || Rails.env.test?
end
Settings.ldap['servers'].each do |key, server|
+ server['label'] ||= 'LDAP'
server['allow_username_or_email_login'] = false if server['allow_username_or_email_login'].nil?
server['active_directory'] = true if server['active_directory'].nil?
server['provider_name'] ||= "ldap#{key}".downcase
diff --git a/config/initializers/7_omniauth.rb b/config/initializers/7_omniauth.rb
index b8ac87fbd5a..18759f0cfb0 100644
--- a/config/initializers/7_omniauth.rb
+++ b/config/initializers/7_omniauth.rb
@@ -1,7 +1,8 @@
if Gitlab::LDAP::Config.enabled?
module OmniAuth::Strategies
server = Gitlab.config.ldap.servers.values.first
- const_set(server['provider_class'], Class.new(LDAP))
+ klass = server['provider_class']
+ const_set(klass, Class.new(LDAP)) unless klass == 'LDAP'
end
OmniauthCallbacksController.class_eval do