add LDAP conf at domain creation

This commit is contained in:
Yunohost 2013-06-22 12:36:11 +02:00
parent 2e551f40a7
commit 5b8226dcac

View file

@ -172,6 +172,15 @@ def domain_add(domains, web=False, main=False):
conf_lines = [ conf_lines = [
'VirtualHost "'+ domain +'"', 'VirtualHost "'+ domain +'"',
' authentication = "ldap2"', ' authentication = "ldap2"',
' ldap = {',
' hostname = "localhost",',
' user = {',
' basedn = "ou=users,dc=yunohost,dc=org",',
' filter = "(&(objectClass=posixAccount)(mail=*@'+ domain +'))",',
' usernamefield = "mail",',
' namefield = "cn",',
' },',
' }',
] ]
with open('/etc/metronome/conf.d/' + domain + '.cfg.lua', 'w') as conf: with open('/etc/metronome/conf.d/' + domain + '.cfg.lua', 'w') as conf:
for line in conf_lines: for line in conf_lines: