diff options
author | Marin Jankovski <marin@gitlab.com> | 2014-03-26 15:38:14 +0100 |
---|---|---|
committer | Marin Jankovski <marin@gitlab.com> | 2014-03-26 15:38:14 +0100 |
commit | 7bf92b368fae70c835c729515f9dac1fb766c185 (patch) | |
tree | 2ed009aafdb6d327ccbeb2158e34062f494ee69c /lib | |
parent | 78a7a9b0be5f4f257ee491a88df7c85fcb2b926b (diff) | |
download | gitlab-ce-7bf92b368fae70c835c729515f9dac1fb766c185.tar.gz |
Ldap check recognize ldap user filter.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tasks/gitlab/check.rake | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake index 071760c0c36..3b9b2531bf7 100644 --- a/lib/tasks/gitlab/check.rake +++ b/lib/tasks/gitlab/check.rake @@ -677,7 +677,20 @@ namespace :gitlab do end def filter - Net::LDAP::Filter.present?(ldap_config.uid) + uid_filter = Net::LDAP::Filter.present?(ldap_config.uid) + if user_filter + Net::LDAP::Filter.join(uid_filter, user_filter) + else + uid_filter + end + end + + def user_filter + if ldap_config['user_filter'] && ldap_config.user_filter.present? + Net::LDAP::Filter.construct(ldap_config.user_filter) + else + nil + end end def ldap |