diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-03-05 12:43:14 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-03-05 12:43:14 +0000 |
commit | a70737ad592cb6c695db29dc1c3579f616877175 (patch) | |
tree | c961440962f38637756dfb49226ef666b264920c /app/models | |
parent | 745fec76d0f81c6536540ebfad497b264a5bd0f0 (diff) | |
download | redmine-a70737ad592cb6c695db29dc1c3579f616877175.tar.gz redmine-a70737ad592cb6c695db29dc1c3579f616877175.zip |
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
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/auth_source_ldap.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/models/auth_source_ldap.rb b/app/models/auth_source_ldap.rb index 5a6789a3b..b4966c1e8 100644 --- a/app/models/auth_source_ldap.rb +++ b/app/models/auth_source_ldap.rb @@ -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) |