Default configuration
This commit is contained in:
System User
2010-12-02 17:58:56 +01:00
parent 766adcda50
commit 8ad91b74b6
3 changed files with 32 additions and 6 deletions

View File

@@ -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")