Changed LDAP#search to return T/F instead of numeric LDAP code,

and adjusted the tests accordingly.
This commit is contained in:
blackhedd 2006-04-23 01:17:49 +00:00
parent 030bb9c6d4
commit f8649bc54e
2 changed files with 12 additions and 11 deletions

View file

@ -199,22 +199,21 @@ module Net
#
def search args
if @open_connection
result_code = @open_connection.search( args ) {|values|
@result = @open_connection.search( args ) {|values|
block_given? and yield( values )
}
result_code
else
result_code = 0
@result = 0
conn = Connection.new( :host => @host, :port => @port )
if (result_code = conn.bind( args[:auth] || @auth )) == 0
result_code = conn.search( args ) {|values|
if (@result = conn.bind( args[:auth] || @auth )) == 0
@result = conn.search( args ) {|values|
block_given? and yield( values )
}
end
conn.close
result_code
end
@result == 0
end
#