Permalink
Browse files

only use Conditions2Filter if needed

  • Loading branch information...
1 parent 5f8ddeb commit 32f4447d455347c7ed4910edb59f86811d8a4a28 @krissi krissi committed Dec 14, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/ldap/net_ldap_facade.rb
@@ -65,13 +65,14 @@ def create_object(dn_prefix, treebase, key_field, props, silence = false)
# @param Array of conditions for the search
# @return Array of Hashes with a name/values pair for each attribute
def read_objects(treebase, key_fields, conditions, field_names, order_field = nil)
- searchbase = base(treebase)
- filter = Conditions2Filter.convert(conditions)
# If there is a :dn in the filter skip everything and look it up
if dn = conditions.detect { |c| c[1] == "dn" } then
searchbase = dn[2]
filter = nil
+ else
+ searchbase = base(treebase)
+ filter = Conditions2Filter.convert(conditions)
end
result = []

0 comments on commit 32f4447

Please sign in to comment.