cn => dn
Default configuration
This commit is contained in:
@ -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")
|
||||
|
@ -56,7 +56,15 @@ INITIAL_CONFIG = {
|
||||
"filename": "/etc/radicale/users",
|
||||
"encryption": "crypt"},
|
||||
"storage": {
|
||||
"folder": os.path.expanduser("~/.config/radicale/calendars")}}
|
||||
"folder": os.path.expanduser("~/.config/radicale/calendars")},
|
||||
"authLdap": {
|
||||
"LDAPServer": "127.0.0.1",
|
||||
"LDAPPrepend": "uid=",
|
||||
"LDAPAppend": "ou=users,dc=example,dc=com"},
|
||||
"logging": {
|
||||
"file": os.path.expanduser("~/.config/radicale/radicale.log"),
|
||||
"level": "error"}
|
||||
}
|
||||
|
||||
# Create a ConfigParser and configure it
|
||||
_CONFIG_PARSER = ConfigParser()
|
||||
|
Reference in New Issue
Block a user