diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-05-14 20:11:14 +0400 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-05-14 20:11:14 +0400 |
commit | 982d4d51e8110bec280eb00db0fb756b062103d9 (patch) | |
tree | af82769b180392c9613d6cdac6b500ec47fd6085 /lib | |
parent | f4bca105d16e3bc47c2cd2725c519d2dcd788e70 (diff) |
Backport Adapter#dn_matches_filter? from EE
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ldap/adapter.rb | 4 |
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) |