mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-09 15:10:27 +00:00
Update models.py
Update AD search filter
This commit is contained in:
parent
56dd74a514
commit
7c6801158d
@ -18,6 +18,7 @@ LDAP_URI = app.config['LDAP_URI']
|
||||
LDAP_USERNAME = app.config['LDAP_USERNAME']
|
||||
LDAP_PASSWORD = app.config['LDAP_PASSWORD']
|
||||
LDAP_SEARCH_BASE = app.config['LDAP_SEARCH_BASE']
|
||||
LDAP_TYPE = app.config['LDAP_TYPE']
|
||||
|
||||
PDNS_STATS_URL = app.config['PDNS_STATS_URL']
|
||||
PDNS_API_KEY = app.config['PDNS_API_KEY']
|
||||
@ -146,7 +147,10 @@ class User(db.Model):
|
||||
return False
|
||||
|
||||
elif method == 'LDAP':
|
||||
searchFilter = "cn=%s" % self.username
|
||||
if LDAP_TYPE == 'ldap':
|
||||
searchFilter = "cn=%s" % self.username
|
||||
else:
|
||||
searchFilter = "sammaaccount=%s" % self.username
|
||||
try:
|
||||
result = self.ldap_search(searchFilter, LDAP_SEARCH_BASE)
|
||||
except Exception, e:
|
||||
|
Loading…
Reference in New Issue
Block a user