Skip to content
Snippets Groups Projects
Commit c54f15e3 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang
Browse files

Do not request blank LDAP attributes.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2056 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent db37e578
No related merge requests found
......@@ -38,7 +38,8 @@ class AuthSource < ActiveRecord::Base
begin
logger.debug "Authenticating '#{login}' against '#{source.name}'" if logger && logger.debug?
attrs = source.authenticate(login, password)
rescue
rescue => e
logger.error "Error during authentication: #{e.message}"
attrs = nil
end
return attrs if attrs
......
......@@ -91,6 +91,8 @@ class AuthSourceLdap < AuthSource
end
def self.get_attr(entry, attr_name)
entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name]
if !attr_name.blank?
entry[attr_name].is_a?(Array) ? entry[attr_name].first : entry[attr_name]
end
end
end
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment