From 02323d2fada0a9353d1060cf41e8d7fb2e60cd14 Mon Sep 17 00:00:00 2001 From: Chuyen Vo Date: Thu, 17 Mar 2016 17:45:50 +0700 Subject: [PATCH] Fix AD searchfilter --- app/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models.py b/app/models.py index e9a78f8..b56487b 100644 --- a/app/models.py +++ b/app/models.py @@ -150,7 +150,7 @@ class User(db.Model): if LDAP_TYPE == 'ldap': searchFilter = "cn=%s" % self.username else: - searchFilter = "sammaaccount=%s" % self.username + searchFilter = "(&(objectcategory=person)(samaccountname=%s))" % self.username try: result = self.ldap_search(searchFilter, LDAP_SEARCH_BASE) except Exception, e: