# File lib/active_ldap/operations.rb, line 79 def exist?(dn, options={}) attr, value, prefix = split_search_value(dn) options_for_leaf = { :attribute => attr, :value => value, :prefix => prefix, :limit => 1, } attribute = attr || ensure_search_attribute options_for_non_leaf = { :attribute => attr, :value => value, :prefix => ["#{attribute}=#{value}", prefix].compact.join(","), :limit => 1, :scope => :base, } !search(options_for_leaf.merge(options)).empty? or !search(options_for_non_leaf.merge(options)).empty? end