File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ class LDAP
263263
264264 class LdapError < Exception ; end
265265
266- VERSION = "0.0.3 "
266+ VERSION = "0.0.4 "
267267
268268
269269 SearchScope_BaseObject = 0
@@ -720,12 +720,15 @@ def bind_as args={}
720720 open { |me |
721721 rs = search args
722722 if rs and rs . first and dn = rs . first . dn
723- result = bind :method => :simple , :username => dn , :password => args [ :password ]
723+ password = args [ :password ]
724+ password = password . call if password . respond_to? ( :call )
725+ result = rs if bind :method => :simple , :username => dn , :password => password
724726 end
725727 }
726728 result
727729 end
728730
731+
729732 # Adds a new entry to the remote LDAP server.
730733 # Supported arguments:
731734 # :dn :: Full DN of the new entry
@@ -1086,6 +1089,7 @@ def bind auth
10861089 #
10871090 def search args = { }
10881091 search_filter = ( args && args [ :filter ] ) || Filter . eq ( "objectclass" , "*" )
1092+ #search_filter = Filter.construct(search_filter) if search_filter.is_a?(String)
10891093 search_base = ( args && args [ :base ] ) || "dc=example,dc=com"
10901094 search_attributes = ( ( args && args [ :attributes ] ) || [ ] ) . map { |attr | attr . to_s . to_ber }
10911095 return_referrals = args && args [ :return_referrals ] == true
You can’t perform that action at this time.
0 commit comments