Merge pull request #23 from danabr/correct_return_value_from_search

Correct return value from search
This commit is contained in:
Rory O'Connell 2011-09-24 11:33:38 -07:00
commit 5344d73543
2 changed files with 35 additions and 2 deletions

View file

@ -619,7 +619,7 @@ class Net::LDAP
end
args[:base] ||= @base
result_set = (args and args[:return_result] == false) ? nil : []
result_set = args[:return_result] == false ? nil : []
if @open_connection
@result = @open_connection.search(args) { |entry|
@ -642,7 +642,11 @@ class Net::LDAP
end
end
result_set || @result == 0
if args[:return_result]
@result == 0 ? result_set : nil
else
@result == 0
end
end
# #bind connects to an LDAP server and requests authentication based on