Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
roomlist
Commits
f6815539
Commit
f6815539
authored
Dec 23, 2016
by
Daniel W Bond
Browse files
incorporated support for ldap fallback
parent
81ed1d79
Changes
1
Hide whitespace changes
Inline
Side-by-side
roomlist/accounts/cas_callbacks.py
View file @
f6815539
...
...
@@ -41,14 +41,20 @@ def pfinfo(uname):
else
:
pfjson
=
metadata
.
json
()
try
:
if
len
(
pfjson
[
'results'
])
==
1
:
name_str
=
pfjson
[
'results'
][
0
][
'name'
]
name
=
pfparse
(
name_str
)
major
=
pfjson
[
'results'
][
0
][
'major'
]
# could conceivably throw a key error
final_tuple
=
(
name
,
major
)
if
len
(
pfjson
[
'results'
])
==
1
:
# ordinary case
if
pfjson
[
'method'
]
==
'peoplefinder'
:
name_str
=
pfjson
[
'results'
][
0
][
'name'
]
name
=
pfparse
(
name_str
)
major
=
pfjson
[
'results'
][
0
][
'major'
]
# could conceivably throw a key error
final_tuple
=
(
name
,
major
)
elif
pfjson
[
'method'
]
==
'ldap'
:
name
=
[
pfjson
[
'results'
][
0
][
'givenname'
],
# includes middle initial
pfjson
[
'results'
][
0
][
'surname'
]]
major
=
''
# ldap does not have major information
final_tuple
=
(
name
,
major
)
return
final_tuple
else
:
else
:
# handles student employees
name_str
=
pfjson
[
'results'
][
1
][
'name'
]
name
=
pfparse
(
name_str
)
major
=
pfjson
[
'results'
][
1
][
'major'
]
...
...
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