Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
ops_sdk
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PublicSource
ops_sdk
Commits
31002a8f
Commit
31002a8f
authored
Jul 11, 2019
by
shenshuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化LDAP
parent
5cdaf8d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
ldap.py
websdk/ldap.py
+3
-3
No files found.
websdk/ldap.py
View file @
31002a8f
...
...
@@ -40,8 +40,8 @@ class LdapApi:
res
=
conn
.
search
(
search_base
=
search_base
,
search_filter
=
'({}={})'
.
format
(
search_filter
,
username
),
search_scope
=
SUBTREE
,
attributes
=
[
'cn'
,
'givenName'
,
'email'
,
'mail'
,
'sAMAccountName'
],
paged_size
=
5
)
#
attributes=['cn', 'givenName', 'email', 'mail', 'sAMAccountName'],
attributes
=
[
'cn'
,
'email'
,
'mail'
],
paged_size
=
5
)
if
res
:
entry
=
conn
.
response
[
0
]
...
...
@@ -55,7 +55,7 @@ class LdapApi:
conn2
.
bind
()
if
conn2
.
result
[
"description"
]
==
"success"
:
if
attr_dict
[
"email"
]:
email
=
attr_dict
[
"email"
][
0
]
email
=
attr_dict
[
"email"
][
0
]
elif
attr_dict
[
"mail"
]:
email
=
attr_dict
[
"mail"
][
0
]
else
:
...
...
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