Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Fachschaftsrat Physik TUKL
Protokoll
protokoll_skript
Commits
456df757
Verified
Commit
456df757
authored
Jun 21, 2019
by
Lorenz Steinert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ldap search
fixes
#5
parent
9beba436
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
bin/module/esme.py
bin/module/esme.py
+8
-10
No files found.
bin/module/esme.py
View file @
456df757
...
...
@@ -92,8 +92,8 @@ class FsrLdap:
"""
logging
.
info
(
"Fetching Protokollant from LDAP ..."
)
try
:
fil
=
"(
uid="
+
current_user
()
+
"
)"
if
self
.
conn
.
search
(
'ou=people,'
+
self
.
base
,
fil
,
fil
=
"(
objectClass=posixAccount
)"
if
self
.
conn
.
search
(
'
uid='
+
current_user
()
+
',
ou=people,'
+
self
.
base
,
fil
,
# noqa: E501
attributes
=
[
'displayName'
]):
logging
.
info
(
"Done"
)
return
" "
.
join
(
str
(
self
.
conn
.
entries
[
0
][
'displayName'
]).
split
(
", "
)[::
-
1
])
# noqa: E501
...
...
@@ -157,10 +157,9 @@ class FsrLdap:
fil
=
'(cn=intern)'
fsr
=
[]
if
self
.
conn
.
search
(
'ou=group,'
+
self
.
base
,
fil
,
attributes
=
[
'memberUid'
]):
for
i
in
self
.
conn
.
entries
[
0
][
'memberUid'
]:
if
self
.
conn
.
search
(
'ou=people,'
+
self
.
base
,
'(uid='
+
i
+
')'
,
attributes
=
[
'member'
]):
for
i
in
self
.
conn
.
entries
[
0
][
'member'
]:
if
self
.
conn
.
search
(
i
,
'(objectClass=posixAccount)'
,
attributes
=
[
'displayName'
]):
fsr
+=
[
str
(
self
.
conn
.
entries
[
0
][
'displayName'
])]
fsr
.
sort
()
...
...
@@ -232,10 +231,9 @@ class FsrLdap:
fil
=
'(cn=extern)'
fsr_extern
=
[]
if
self
.
conn
.
search
(
'ou=group,'
+
self
.
base
,
fil
,
attributes
=
[
'memberUid'
]):
for
i
in
self
.
conn
.
entries
[
0
][
'memberUid'
]:
if
self
.
conn
.
search
(
'ou=people,'
+
self
.
base
,
'(uid='
+
i
+
')'
,
attributes
=
[
'member'
]):
for
i
in
self
.
conn
.
entries
[
0
][
'member'
]:
if
self
.
conn
.
search
(
i
,
'(objectClass=posixAccount)'
,
attributes
=
[
'displayName'
]):
fsr_extern
+=
[
str
(
self
.
conn
.
entries
[
0
][
'displayName'
])]
# noqa: E501
fsr_extern
.
sort
()
...
...
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