Prevent redeclaration of LDAP strategy

This commit is contained in:
Jan-Willem van der Meer 2014-10-17 18:03:34 +02:00
parent bd9d9b6def
commit d1c3864778

View file

@ -1,7 +1,8 @@
if Gitlab::LDAP::Config.enabled? if Gitlab::LDAP::Config.enabled?
module OmniAuth::Strategies module OmniAuth::Strategies
server = Gitlab.config.ldap.servers.values.first 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 end
OmniauthCallbacksController.class_eval do OmniauthCallbacksController.class_eval do