summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin Frick <marvin.frick@sinnerschrader.com>2014-11-12 12:06:24 +0100
committerMarvin Frick <marvin.frick@sinnerschrader.com>2014-11-12 12:06:24 +0100
commit1f902c2464a4f5c68f1b42be597d4e3e25a32130 (patch)
tree3e297a38509d9fa24755e9d2a6fd45609acbc79c
parentc58edd7c708c39a6e7c60bd96c7f97ced370f304 (diff)
downloadgitlab-ce-1f902c2464a4f5c68f1b42be597d4e3e25a32130.tar.gz
fixes the `block_removed_ldap_users` rake task
In e23a26a (and later 1bc9936) the API for Gitlab::LDAP::Adapter was changed. I assume this rake task was an oversight in the refactoring of the changed class. While being on it, I noticed that already blocked users cannot be blocked again.
-rw-r--r--lib/tasks/gitlab/cleanup.rake4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/tasks/gitlab/cleanup.rake b/lib/tasks/gitlab/cleanup.rake
index 63dcdc52370..189ad6090a4 100644
--- a/lib/tasks/gitlab/cleanup.rake
+++ b/lib/tasks/gitlab/cleanup.rake
@@ -92,11 +92,11 @@ namespace :gitlab do
User.ldap.each do |ldap_user|
print "#{ldap_user.name} (#{ldap_user.extern_uid}) ..."
- if Gitlab::LDAP::Access.open { |access| access.allowed?(ldap_user) }
+ if Gitlab::LDAP::Access.allowed?(ldap_user)
puts " [OK]".green
else
if block_flag
- ldap_user.block!
+ ldap_user.block! unless ldap_user.blocked?
puts " [BLOCKED]".red
else
puts " [NOT IN LDAP]".yellow