[shortcuts] En local on se connecte toujours avec les ids readonly
This commit is contained in:
parent
db9bf4540f
commit
b2abbef3b4
1 changed files with 3 additions and 7 deletions
10
shortcuts.py
10
shortcuts.py
|
@ -79,19 +79,15 @@ def lc_ldap_local(*args, **kwargs):
|
||||||
qui est problématique).
|
qui est problématique).
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
secrets = import_secrets()
|
||||||
|
auth_dn = secrets.ldap_readonly_auth_dn
|
||||||
|
auth_pw = secrets.ldap_readonly_password
|
||||||
if os.path.exists('/var/run/slapd/ldapi'):
|
if os.path.exists('/var/run/slapd/ldapi'):
|
||||||
ro_uri = 'ldapi://%2fvar%2frun%2fslapd%2fldapi/'
|
ro_uri = 'ldapi://%2fvar%2frun%2fslapd%2fldapi/'
|
||||||
auth_dn = ""
|
|
||||||
auth_pw = ""
|
|
||||||
elif os.path.exists('/var/run/ldapi'):
|
elif os.path.exists('/var/run/ldapi'):
|
||||||
ro_uri = 'ldapi://%2fvar%2frun%2fldapi/'
|
ro_uri = 'ldapi://%2fvar%2frun%2fldapi/'
|
||||||
auth_dn = ""
|
|
||||||
auth_pw = ""
|
|
||||||
else:
|
else:
|
||||||
secrets = import_secrets()
|
|
||||||
ro_uri = 'ldap://127.0.0.1'
|
ro_uri = 'ldap://127.0.0.1'
|
||||||
auth_dn = secrets.ldap_readonly_auth_dn
|
|
||||||
auth_pw = secrets.ldap_readonly_password
|
|
||||||
kwargs["uri"] = ro_uri
|
kwargs["uri"] = ro_uri
|
||||||
kwargs["dn"] = auth_dn
|
kwargs["dn"] = auth_dn
|
||||||
kwargs["cred"] = auth_pw
|
kwargs["cred"] = auth_pw
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue