36 parent::__construct(
$consumer,
$endpoint,
'application/vnd.ims.lis.v2.membershipcontainer+json');
49 public function get($role = null, $limit = 0) {
51 $isLink = is_a($this->source,
'IMSGlobal\LTI\ToolProvider\ResourceLink');
52 $parameters =
array();
54 $parameters[
'role'] = $role;
57 $parameters[
'limit'] = strval($limit);
60 $parameters[
'rlid'] = $this->source->getId();
70 foreach (
$http->responseJson->pageOf->membershipSubject->membership as $membership) {
71 $member = $membership->member;
76 $user->ltiUserId = $member->userId;
80 $firstname = (isset($member->givenName)) ? $member->givenName :
'';
81 $lastname = (isset($member->familyName)) ? $member->familyName :
'';
82 $fullname = (isset($member->name)) ? $member->name :
'';
83 $user->setNames($firstname, $lastname, $fullname);
86 $email = (isset($member->email)) ? $member->email :
'';
87 $user->setEmail(
$email, $this->source->getConsumer()->defaultEmail);
90 if (isset($membership->role)) {
96 if (isset($member->message)) {
97 foreach ($member->message as
$message) {
98 if (isset($message->message_type) && ($message->message_type ===
'basic-lti-launch-request')) {
99 if (isset($message->lis_result_sourcedid)) {
100 $user->ltiResultSourcedId = $message->lis_result_sourcedid;
118 foreach ($oldUsers as
$id => $user) {
if(!array_key_exists('StateId', $_REQUEST)) $id
catch(Exception $e) $message
Create styles array
The data for the language used.