mirror of
https://github.com/Kozea/Radicale.git
synced 2025-08-01 18:18:31 +00:00
cn => dn
Default configuration
This commit is contained in:
parent
766adcda50
commit
8ad91b74b6
3 changed files with 32 additions and 6 deletions
|
@ -1,8 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys, ldap
|
||||
import sys, ldap, syslog
|
||||
|
||||
from radicale import config
|
||||
from radicale import config, log
|
||||
|
||||
def has_right(owner, user, password):
|
||||
if user == None:
|
||||
|
@ -13,10 +13,11 @@ def has_right(owner, user, password):
|
|||
return False
|
||||
try:
|
||||
l=ldap.open(LDAPSERVER, 389)
|
||||
cn="%s%s,%s" % (LDAPPREPEND, user, LDAPAPPEND)
|
||||
l.simple_bind_s(cn, password);
|
||||
dn="%s%s,%s" % (LDAPPREPEND, user, LDAPAPPEND)
|
||||
l.simple_bind_s(dn, password);
|
||||
return True
|
||||
except:
|
||||
log.error(sys.exc_info()[0])
|
||||
return False
|
||||
|
||||
LDAPSERVER = config.get("authLdap", "LDAPServer")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue