From e2e900a338894010e7ba4dac89fa7b926803a977 Mon Sep 17 00:00:00 2001 From: Jurnell Cockhren Date: Tue, 28 Jan 2014 15:10:36 -0600 Subject: [PATCH] In the case when a user can and has authenticated with ldap, however ldap is disabled in the gitlab config, this fixes the API still calling the ldap backend. --- lib/api/internal.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/api/internal.rb b/lib/api/internal.rb index ed6b50c3a6a..ebc9fef07b4 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -35,7 +35,9 @@ module API user = key.user return false if user.blocked? - return false if user.ldap_user? && Gitlab::LDAP::User.blocked?(user.extern_uid) + if Gitlab.config.ldap.enabled + return false if user.ldap_user? && Gitlab::LDAP::User.blocked?(user.extern_uid) + end action = case git_cmd when *DOWNLOAD_COMMANDS