Skip to content
Snippets Groups Projects
Commit 20a88f5c authored by Friedrich Beckmann's avatar Friedrich Beckmann
Browse files

LDAP authentication in grack - check ldap conf before call / added comment

parent 228baa80
No related branches found
No related tags found
1 merge request!3758Authenticate LDAP users in the grack module - fixed problems - tested code
Loading
Loading
@@ -34,11 +34,15 @@ module Grack
login, password = @auth.credentials
self.user = User.find_by_email(login) || User.find_by_username(login)
 
if user.nil?
# If the provided login was not a known email or username
# then user is nil
if user.nil?
# Second chance - try LDAP authentication
return false unless Gitlab.config.ldap.enabled
ldap_auth(login,password)
return false unless !user.nil?
else
return false unless user.valid_password?(password);
return false unless user.valid_password?(password)
end
Gitlab::ShellEnv.set_env(user)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment