Commit 4c034142 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Make gitlab ldap check work for old and new syntax

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 37e09858
No related merge requests found
...@@ -676,11 +676,11 @@ namespace :gitlab do ...@@ -676,11 +676,11 @@ namespace :gitlab do
def print_users(limit) def print_users(limit)
puts "LDAP users with access to your GitLab server (only showing the first #{limit} results)" puts "LDAP users with access to your GitLab server (only showing the first #{limit} results)"
servers = Gitlab.config.ldap.servers.keys servers = Gitlab::LDAP::Config.providers
servers.each do |server| servers.each do |server|
puts "Server: #{server}" puts "Server: #{server}"
Gitlab::LDAP::Adapter.open("ldap#{server}") do |adapter| Gitlab::LDAP::Adapter.open(server) do |adapter|
users = adapter.users(adapter.config.uid, '*', 100) users = adapter.users(adapter.config.uid, '*', 100)
users.each do |user| users.each do |user|
puts "\tDN: #{user.dn}\t #{adapter.config.uid}: #{user.uid}" puts "\tDN: #{user.dn}\t #{adapter.config.uid}: #{user.uid}"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment