cn => dn
Default configuration
This commit is contained in:
parent
766adcda50
commit
8ad91b74b6
19
config
19
config
@ -27,7 +27,7 @@ stock = utf-8
|
||||
|
||||
[acl]
|
||||
# Access method
|
||||
# Value: fake | htpasswd
|
||||
# Value: fake | htpasswd | authLdap
|
||||
type = fake
|
||||
# Personal calendars only available for logged in users (if needed)
|
||||
personal = False
|
||||
@ -37,9 +37,26 @@ filename = /etc/radicale/users
|
||||
# Value: plain | sha1 | crypt
|
||||
encryption = crypt
|
||||
|
||||
[authLdap]
|
||||
#LDAP Host
|
||||
LDAPServer = 127.0.0.1
|
||||
#Fields to create a LDAP bind
|
||||
#Value to add before the user name in a LDAP bind
|
||||
LDAPPrepend = uid=
|
||||
#Value to add after the user name in a LDAP bind
|
||||
LDAPAppend = ou=users,dc=exmaple,dc=dom
|
||||
#=> uid=corentin,ou=users,dc=exmaple,dc=dom
|
||||
|
||||
[storage]
|
||||
# Folder for storing local calendars,
|
||||
# created if not present
|
||||
folder = ~/.config/radicale/calendars
|
||||
|
||||
[logging]
|
||||
# Full path of logfile
|
||||
file = ~/.config/radicale/radicale.log
|
||||
# Logging messages which are less severe than level will be ignored
|
||||
# Log level are (debug, info, warning, error, critical)
|
||||
level = error
|
||||
|
||||
# vim:ft=cfg
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user