diff options
author | Drew Blessing <drew@gitlab.com> | 2015-12-08 09:47:42 -0600 |
---|---|---|
committer | Drew Blessing <drew@gitlab.com> | 2015-12-08 11:15:30 -0600 |
commit | bf5683f8892c4aefc4c996812ece6291b701dada (patch) | |
tree | 0d16e4ef7bd4232b83882fc210b84771f6ae0c81 /lib | |
parent | 14165e59726b0813af90f785037d96d0973adf6d (diff) | |
download | gitlab-ce-bf5683f8892c4aefc4c996812ece6291b701dada.tar.gz |
Block LDAP user when they are no longer found in the LDAP server
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ldap/access.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/ldap/access.rb b/lib/gitlab/ldap/access.rb index 16ff03c38d4..c438a3d167b 100644 --- a/lib/gitlab/ldap/access.rb +++ b/lib/gitlab/ldap/access.rb @@ -37,13 +37,15 @@ module Gitlab # Block user in GitLab if he/she was blocked in AD if Gitlab::LDAP::Person.disabled_via_active_directory?(user.ldap_identity.extern_uid, adapter) - user.block unless user.blocked? + user.block false else user.activate if user.blocked? && !ldap_config.block_auto_created_users true end else + # Block the user if they no longer exist in LDAP/AD + user.block false end rescue |