summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2013-12-03 18:51:21 +0100
committerJacob Vosmaer <contact@jacobvosmaer.nl>2013-12-03 18:51:21 +0100
commit80302a0f6f4fcfe5adf719888f8ad67422a98d4d (patch)
tree656cb5cdff80636ccb775a8dc262e58afce0f708 /lib
parent376cfc6ac68da97af33dfdc1a17e75ab157f5b59 (diff)
downloadgitlab-ce-80302a0f6f4fcfe5adf719888f8ad67422a98d4d.tar.gz
Limit the number of results in gitlab:ldap:check
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/gitlab/check.rake11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake
index 1cea4ff806c..20d5f03d6ef 100644
--- a/lib/tasks/gitlab/check.rake
+++ b/lib/tasks/gitlab/check.rake
@@ -681,12 +681,13 @@ namespace :gitlab do
end
namespace :ldap do
- task check: :environment do
+ task :check, [:limit] => :environment do |t, args|
+ args.with_defaults(limit: 100)
warn_user_is_not_gitlab
start_checking "LDAP"
if ldap_config.enabled
- print_users
+ print_users(args.limit)
else
puts 'LDAP is disabled in config/gitlab.yml'
end
@@ -694,9 +695,9 @@ namespace :gitlab do
finished_checking "LDAP"
end
- def print_users
- puts 'The following LDAP users can log in to your GitLab server:'
- ldap.search(attributes: attributes, filter: filter, return_result: false) do |entry|
+ def print_users(limit)
+ puts "LDAP users with access to your GitLab server (limit: #{limit}):"
+ ldap.search(attributes: attributes, filter: filter, size: limit, return_result: false) do |entry|
puts "DN: #{entry.dn}\t#{ldap_config.uid}: #{entry[ldap_config.uid]}"
end
end