mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-01-07 19:05:39 +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_USERNAME = app.config['LDAP_USERNAME']
|
||||||
LDAP_PASSWORD = app.config['LDAP_PASSWORD']
|
LDAP_PASSWORD = app.config['LDAP_PASSWORD']
|
||||||
LDAP_SEARCH_BASE = app.config['LDAP_SEARCH_BASE']
|
LDAP_SEARCH_BASE = app.config['LDAP_SEARCH_BASE']
|
||||||
|
LDAP_TYPE = app.config['LDAP_TYPE']
|
||||||
|
|
||||||
PDNS_STATS_URL = app.config['PDNS_STATS_URL']
|
PDNS_STATS_URL = app.config['PDNS_STATS_URL']
|
||||||
PDNS_API_KEY = app.config['PDNS_API_KEY']
|
PDNS_API_KEY = app.config['PDNS_API_KEY']
|
||||||
@ -146,7 +147,10 @@ class User(db.Model):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
elif method == 'LDAP':
|
elif method == 'LDAP':
|
||||||
searchFilter = "cn=%s" % self.username
|
if LDAP_TYPE == 'ldap':
|
||||||
|
searchFilter = "cn=%s" % self.username
|
||||||
|
else:
|
||||||
|
searchFilter = "sammaaccount=%s" % self.username
|
||||||
try:
|
try:
|
||||||
result = self.ldap_search(searchFilter, LDAP_SEARCH_BASE)
|
result = self.ldap_search(searchFilter, LDAP_SEARCH_BASE)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
Loading…
Reference in New Issue
Block a user