Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jannik Hellenkamp
website
Commits
0b8fe4f0
Commit
0b8fe4f0
authored
Jan 25, 2018
by
Andreas Valder
Browse files
fix a syntax error
parent
4a3e24dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
ldap.py
View file @
0b8fe4f0
...
...
@@ -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
]}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment