From faed957164a25265e1196e5b8a196c48028aead5 Mon Sep 17 00:00:00 2001 From: blackhedd Date: Tue, 15 Aug 2006 08:33:18 +0000 Subject: [PATCH] Changed version to 4. Changed Net::LDAP#bind_as returns a result set now. --- lib/net/ldap.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/net/ldap.rb b/lib/net/ldap.rb index b052821..2515a67 100644 --- a/lib/net/ldap.rb +++ b/lib/net/ldap.rb @@ -263,7 +263,7 @@ module Net class LdapError < Exception; end - VERSION = "0.0.3" + VERSION = "0.0.4" SearchScope_BaseObject = 0 @@ -720,12 +720,15 @@ module Net open {|me| rs = search args if rs and rs.first and dn = rs.first.dn - result = bind :method => :simple, :username => dn, :password => args[:password] + password = args[:password] + password = password.call if password.respond_to?(:call) + result = rs if bind :method => :simple, :username => dn, :password => password end } result end + # Adds a new entry to the remote LDAP server. # Supported arguments: # :dn :: Full DN of the new entry @@ -1086,6 +1089,7 @@ module Net # def search args = {} search_filter = (args && args[:filter]) || Filter.eq( "objectclass", "*" ) + #search_filter = Filter.construct(search_filter) if search_filter.is_a?(String) search_base = (args && args[:base]) || "dc=example,dc=com" search_attributes = ((args && args[:attributes]) || []).map {|attr| attr.to_s.to_ber} return_referrals = args && args[:return_referrals] == true