ldap: Add a setting to automatically deactivate non_matching users.

Fixes: #11151.
This commit is contained in:
Harshit Bansal
2019-01-13 12:53:52 +00:00
committed by Tim Abbott
parent 6797dea6c3
commit 71761bc2da
6 changed files with 42 additions and 1 deletions

View File

@@ -28,6 +28,8 @@ def sync_ldap_user_data(user_profiles: List[UserProfile]) -> None:
logger.info("Updated %s." % (u.email,))
else:
logger.warning("Did not find %s in LDAP." % (u.email,))
if settings.LDAP_DEACTIVATE_NON_MATCHING_USERS:
logger.info("Deactivated non-matching user: %s" % (u.email,))
except ZulipLDAPException as e:
logger.error("Error attempting to update user %s:" % (u.email,))
logger.error(e)