[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
16
shortcuts.py
16
shortcuts.py
|
@ -79,19 +79,15 @@ def lc_ldap_local(*args, **kwargs):
|
|||
qui est problématique).
|
||||
|
||||
"""
|
||||
if os.path.exists('/var/run/slapd/ldapi'):
|
||||
ro_uri = 'ldapi://%2fvar%2frun%2fslapd%2fldapi/'
|
||||
auth_dn = ""
|
||||
auth_pw = ""
|
||||
elif os.path.exists('/var/run/ldapi'):
|
||||
ro_uri = 'ldapi://%2fvar%2frun%2fldapi/'
|
||||
auth_dn = ""
|
||||
auth_pw = ""
|
||||
else:
|
||||
secrets = import_secrets()
|
||||
ro_uri = 'ldap://127.0.0.1'
|
||||
auth_dn = secrets.ldap_readonly_auth_dn
|
||||
auth_pw = secrets.ldap_readonly_password
|
||||
if os.path.exists('/var/run/slapd/ldapi'):
|
||||
ro_uri = 'ldapi://%2fvar%2frun%2fslapd%2fldapi/'
|
||||
elif os.path.exists('/var/run/ldapi'):
|
||||
ro_uri = 'ldapi://%2fvar%2frun%2fldapi/'
|
||||
else:
|
||||
ro_uri = 'ldap://127.0.0.1'
|
||||
kwargs["uri"] = ro_uri
|
||||
kwargs["dn"] = auth_dn
|
||||
kwargs["cred"] = auth_pw
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue