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
This commit is contained in:
parent
745fec76d0
commit
a70737ad59
|
@ -70,11 +70,12 @@ class AuthSourceLdap < AuthSource
|
||||||
|
|
||||||
private
|
private
|
||||||
def initialize_ldap_con(ldap_user, ldap_password)
|
def initialize_ldap_con(ldap_user, ldap_password)
|
||||||
Net::LDAP.new( {:host => self.host,
|
options = { :host => self.host,
|
||||||
:port => self.port,
|
:port => self.port,
|
||||||
:auth => { :method => :simple, :username => ldap_user, :password => ldap_password },
|
:encryption => (self.tls ? :simple_tls : nil)
|
||||||
: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
|
end
|
||||||
|
|
||||||
def self.get_attr(entry, attr_name)
|
def self.get_attr(entry, attr_name)
|
||||||
|
|
Loading…
Reference in New Issue