forked from unit/ldap-panel
added tls as option
This commit is contained in:
parent
ced4a29aed
commit
7a3d365928
1
app.py
1
app.py
|
@ -58,6 +58,7 @@ def ldap_change_password(username, old, new):
|
||||||
l = ldap.initialize(CONF['ldap']['host'])
|
l = ldap.initialize(CONF['ldap']['host'])
|
||||||
l.set_option(ldap.OPT_X_TLS_CACERTFILE, CONF['ldap']['tls_cacert'])
|
l.set_option(ldap.OPT_X_TLS_CACERTFILE, CONF['ldap']['tls_cacert'])
|
||||||
l.set_option(ldap.OPT_X_TLS, ldap.OPT_X_TLS_DEMAND)
|
l.set_option(ldap.OPT_X_TLS, ldap.OPT_X_TLS_DEMAND)
|
||||||
|
if CONF['ldap']['tls'] == "True":
|
||||||
l.start_tls_s()
|
l.start_tls_s()
|
||||||
l.simple_bind_s(dn_name, old)
|
l.simple_bind_s(dn_name, old)
|
||||||
l.passwd_s(dn_name, old, new)
|
l.passwd_s(dn_name, old, new)
|
||||||
|
|
|
@ -4,6 +4,7 @@ page_title = Change your password on unit.macaomilano.org
|
||||||
[ldap]
|
[ldap]
|
||||||
host = ldap://unit.macaomilano.org:389
|
host = ldap://unit.macaomilano.org:389
|
||||||
base = ou=Hackers,dc=unit,dc=macaomilano,dc=org
|
base = ou=Hackers,dc=unit,dc=macaomilano,dc=org
|
||||||
|
tls = True
|
||||||
tls_cacert = /etc/ssl/cert.pem
|
tls_cacert = /etc/ssl/cert.pem
|
||||||
|
|
||||||
[server]
|
[server]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user