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

View File

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