Changed version to 4.
Changed Net::LDAP#bind_as returns a result set now.
This commit is contained in:
parent
e2bf4dc172
commit
faed957164
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue