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
74e10220
Commit
74e10220
authored
Nov 04, 2019
by
张鹏飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ldap增加返回nicknaame
parent
3c164038
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
ldap.py
websdk/ldap.py
+2
-2
No files found.
websdk/ldap.py
View file @
74e10220
...
@@ -41,7 +41,7 @@ class LdapApi:
...
@@ -41,7 +41,7 @@ class LdapApi:
search_filter
=
'({}={})'
.
format
(
search_filter
,
username
),
search_filter
=
'({}={})'
.
format
(
search_filter
,
username
),
search_scope
=
SUBTREE
,
search_scope
=
SUBTREE
,
# attributes=['cn', 'givenName', 'email', 'mail', 'sAMAccountName'],
# attributes=['cn', 'givenName', 'email', 'mail', 'sAMAccountName'],
attributes
=
[
'cn'
,
'email'
,
'mail'
],
paged_size
=
5
)
attributes
=
[
'cn'
,
'email'
,
'mail'
,
'displayName'
],
paged_size
=
5
)
if
res
:
if
res
:
entry
=
conn
.
response
[
0
]
entry
=
conn
.
response
[
0
]
...
@@ -61,7 +61,7 @@ class LdapApi:
...
@@ -61,7 +61,7 @@ class LdapApi:
else
:
else
:
email
=
None
email
=
None
return
True
,
attr_dict
[
"cn"
][
0
],
email
return
True
,
attr_dict
[
"cn"
][
0
],
email
,
attr_dict
[
'displayName'
]
else
:
else
:
print
(
"auth fail"
)
print
(
"auth fail"
)
return
False
,
None
,
None
return
False
,
None
,
None
...
...
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