restrict name to be set to lis_person_name_full (should be display name) or to lis_person_name_given (should be first name).

don't use xikolo api any longer for consumer openHPI, use the values in CodeOcean.
This commit is contained in:
Ralf Teusner
2017-04-03 15:26:02 +02:00
parent 778ee7c374
commit ce2823e871
2 changed files with 6 additions and 8 deletions

View File

@ -42,12 +42,12 @@ module Lti
private :external_user_email
def external_user_name(provider)
# save person_name_full if supplied. this is the display_name, if it is set.
# else only save the firstname, we don't want lastnames (family names)
if provider.lis_person_name_full
provider.lis_person_name_full
elsif provider.lis_person_name_given && provider.lis_person_name_family
"#{provider.lis_person_name_given} #{provider.lis_person_name_family}"
else
provider.lis_person_name_given || provider.lis_person_name_family
provider.lis_person_name_given
end
end
private :external_user_name