Commit a70737ad authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Fixed "LdapError: invalid binding information" when no username/password are set…

Fixed "LdapError: invalid binding information" when no username/password are set on the LDAP account (#764).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1194 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 745fec76
......@@ -70,11 +70,12 @@ class AuthSourceLdap < AuthSource
private
def initialize_ldap_con(ldap_user, ldap_password)
Net::LDAP.new( {:host => self.host,
:port => self.port,
:auth => { :method => :simple, :username => ldap_user, :password => ldap_password },
:encryption => (self.tls ? :simple_tls : nil)}
)
options = { :host => self.host,
:port => self.port,
:encryption => (self.tls ? :simple_tls : nil)
}
options.merge(:auth => { :method => :simple, :username => ldap_user, :password => ldap_password }) unless ldap_user.blank? && ldap_password.blank?
Net::LDAP.new options
end
def self.get_attr(entry, attr_name)
......
Markdown is supported
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