Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2014-05-14 20:11:14 +0400
committerJacob Vosmaer <contact@jacobvosmaer.nl>2014-05-14 20:11:14 +0400
commit982d4d51e8110bec280eb00db0fb756b062103d9 (patch)
treeaf82769b180392c9613d6cdac6b500ec47fd6085 /lib/gitlab
parentf4bca105d16e3bc47c2cd2725c519d2dcd788e70 (diff)
Backport Adapter#dn_matches_filter? from EE
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/ldap/adapter.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/ldap/adapter.rb b/lib/gitlab/ldap/adapter.rb
index 7bdcb4b9743..e36616f0e66 100644
--- a/lib/gitlab/ldap/adapter.rb
+++ b/lib/gitlab/ldap/adapter.rb
@@ -77,6 +77,10 @@ module Gitlab
users(*args).first
end
+ def dn_matches_filter?(dn, filter)
+ ldap_search(base: dn, filter: filter, scope: Net::LDAP::SearchScope_BaseObject, attributes: %w{dn}).any?
+ end
+
def ldap_search(*args)
results = ldap.search(*args)