Skip to content
Snippets Groups Projects
Commit 0b8fe4f0 authored by Andreas Valder's avatar Andreas Valder
Browse files

fix a syntax error

parent 4a3e24dd
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ if 'LDAP_HOST' in config:
user = LDAP_USERRE.sub(r'', user.lower())
try:
conn = ldap3.Connection(ldap3.Server(config['LDAP_HOST'], port=config['LDAP_PORT'], use_ssl=True), 'fsmpi\\%s'%user, password, auto_bind=True, check_names=False)
except ldap3.core.exceptions.LDAPBindError, ldap3.core.exceptions.LDAPPasswordIsMandatoryError:
except (ldap3.core.exceptions.LDAPBindError, ldap3.core.exceptions.LDAPPasswordIsMandatoryError):
return {}, []
conn.search("cn=users,dc=fsmpi,dc=rwth-aachen,dc=de", "(cn=%s)"%user, attributes=['memberOf', 'givenName', 'sn'])
info = {'uid': user, 'givenName': conn.response[0]['attributes']['givenName'][0], 'sn': conn.response[0]['attributes']['sn'][0]}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment