'
.' | '.
''.
'';
- my (%checkedfields,%rolemaps);
+ my (%checkedfields,%rolemaps,$userincdom);
if (ref($settings->{$item}) eq 'HASH') {
if (ref($settings->{$item}->{'fields'}) eq 'HASH') {
%checkedfields = %{$settings->{$item}->{'fields'}};
}
+ $userincdom = $settings->{$item}->{'incdom'};
if (ref($settings->{$item}->{'roles'}) eq 'HASH') {
%rolemaps = %{$settings->{$item}->{'roles'}};
$checkedfields{'roles'} = 1;
@@ -3727,16 +3765,40 @@ sub print_ltitools {
}
$datatable .= ''.
+ $datatable .= '';
+ $datatable .= ' '.
+ ' : '.
+ ' ';
+ $datatable .= ''.
''."\n".
' | '."\n".
'
'."\n";
$itemcount ++;
@@ -3912,11 +3987,13 @@ sub ltitools_names {
'title' => 'Title',
'version' => 'Version',
'msgtype' => 'Message Type',
+ 'sigmethod' => 'Signature Method',
'url' => 'URL',
'key' => 'Key',
+ 'lifetime' => 'Nonce lifetime (s)',
'secret' => 'Secret',
'icon' => 'Icon',
- 'user' => 'Username:domain',
+ 'user' => 'User',
'fullname' => 'Full Name',
'firstname' => 'First Name',
'lastname' => 'Last Name',
@@ -3929,13 +4006,12 @@ sub ltitools_names {
'width' => 'Width',
'linktext' => 'Default Link Text',
'explanation' => 'Default Explanation',
- 'passback' => 'Tool can return grades:',
- 'roster' => 'Tool can retrieve roster:',
'crstarget' => 'Display target',
'crslabel' => 'Course label',
'crstitle' => 'Course title',
'crslinktext' => 'Link Text',
'crsexplanation' => 'Explanation',
+ 'crsappend' => 'Provider URL',
);
return %lt;
@@ -9164,8 +9240,11 @@ sub modify_ltitools {
$allpos[$position] = $newid;
}
$changes{$newid} = 1;
- foreach my $item ('title','url','key','secret') {
+ foreach my $item ('title','url','key','secret','lifetime') {
$env{'form.ltitools_add_'.$item} =~ s/(`)/'/g;
+ if ($item eq 'lifetime') {
+ $env{'form.ltitools_add_'.$item} =~ s/[^\d.]//g;
+ }
if ($env{'form.ltitools_add_'.$item}) {
if (($item eq 'key') || ($item eq 'secret')) {
$encconfig{$newid}{$item} = $env{'form.ltitools_add_'.$item};
@@ -9180,6 +9259,11 @@ sub modify_ltitools {
if ($env{'form.ltitools_add_msgtype'} eq 'basic-lti-launch-request') {
$confhash{$newid}{'msgtype'} = $env{'form.ltitools_add_msgtype'};
}
+ if ($env{'form.ltitools_add_sigmethod'} eq 'HMAC-SHA256') {
+ $confhash{$newid}{'sigmethod'} = $env{'form.ltitools_add_sigmethod'};
+ } else {
+ $confhash{$newid}{'sigmethod'} = 'HMAC-SHA1';
+ }
foreach my $item ('width','height','linktext','explanation') {
$env{'form.ltitools_add_'.$item} =~ s/^\s+//;
$env{'form.ltitools_add_'.$item} =~ s/\s+$//;
@@ -9200,11 +9284,6 @@ sub modify_ltitools {
} else {
$confhash{$newid}{'display'}{'target'} = 'iframe';
}
- foreach my $item ('passback','roster') {
- if ($env{'form.ltitools_add_'.$item}) {
- $confhash{$newid}{$item} = 1;
- }
- }
if ($env{'form.ltitools_add_image.filename'} ne '') {
my ($imageurl,$error) =
&process_ltitools_image($r,$dom,$confname,'ltitools_add_image',$newid,
@@ -9235,6 +9314,13 @@ sub modify_ltitools {
}
}
}
+ if (ref($confhash{$newid}{'fields'}) eq 'HASH') {
+ if ($confhash{$newid}{'fields'}{'user'}) {
+ if ($env{'form.ltitools_userincdom_add'}) {
+ $confhash{$newid}{'incdom'} = 1;
+ }
+ }
+ }
my @courseconfig = &Apache::loncommon::get_env_multiple('form.ltitools_courseconfig');
foreach my $item (@courseconfig) {
$confhash{$newid}{'crsconf'}{$item} = 1;
@@ -9270,6 +9356,7 @@ sub modify_ltitools {
my $maxnum = $env{'form.ltitools_maxnum'};
for (my $i=0; $i<=$maxnum; $i++) {
my $itemid = $env{'form.ltitools_id_'.$i};
+ $itemid =~ s/\D+//g;
if (ref($domconfig{$action}{$itemid}) eq 'HASH') {
if ($deletions{$itemid}) {
if ($domconfig{$action}{$itemid}{'image'}) {
@@ -9280,7 +9367,7 @@ sub modify_ltitools {
} else {
my $newpos = $env{'form.ltitools_'.$itemid};
$newpos =~ s/\D+//g;
- foreach my $item ('title','url') {
+ foreach my $item ('title','url','lifetime') {
$confhash{$itemid}{$item} = $env{'form.ltitools_'.$item.'_'.$i};
if ($domconfig{$action}{$itemid}{$item} ne $confhash{$itemid}{$item}) {
$changes{$itemid} = 1;
@@ -9298,6 +9385,18 @@ sub modify_ltitools {
if ($env{'form.ltitools_msgtype_'.$i} eq 'basic-lti-launch-request') {
$confhash{$itemid}{'msgtype'} = $env{'form.ltitools_msgtype_'.$i};
}
+ if ($env{'form.ltitools_sigmethod_'.$i} eq 'HMAC-SHA256') {
+ $confhash{$itemid}{'sigmethod'} = $env{'form.ltitools_sigmethod_'.$i};
+ } else {
+ $confhash{$itemid}{'sigmethod'} = 'HMAC-SHA1';
+ }
+ if ($domconfig{$action}{$itemid}{'sigmethod'} eq '') {
+ if ($confhash{$itemid}{'sigmethod'} ne 'HMAC-SHA1') {
+ $changes{$itemid} = 1;
+ }
+ } elsif ($domconfig{$action}{$itemid}{'sigmethod'} ne $confhash{$itemid}{'sigmethod'}) {
+ $changes{$itemid} = 1;
+ }
foreach my $size ('width','height') {
$env{'form.ltitools_'.$size.'_'.$i} =~ s/^\s+//;
$env{'form.ltitools_'.$size.'_'.$i} =~ s/\s+$//;
@@ -9348,16 +9447,8 @@ sub modify_ltitools {
} else {
$changes{$itemid} = 1;
}
- foreach my $extra ('passback','roster') {
- if ($env{'form.ltitools_'.$extra.'_'.$i}) {
- $confhash{$itemid}{$extra} = 1;
- }
- if ($domconfig{$action}{$itemid}{$extra} ne $confhash{$itemid}{$extra}) {
- $changes{$itemid} = 1;
- }
- }
my @courseconfig = &Apache::loncommon::get_env_multiple('form.ltitools_courseconfig_'.$i);
- foreach my $item ('label','title','target','linktext','explanation') {
+ foreach my $item ('label','title','target','linktext','explanation','append') {
if (grep(/^\Q$item\E$/,@courseconfig)) {
$confhash{$itemid}{'crsconf'}{$item} = 1;
if (ref($domconfig{$action}{$itemid}{'crsconf'}) eq 'HASH') {
@@ -9401,6 +9492,16 @@ sub modify_ltitools {
}
}
}
+ if (ref($confhash{$itemid}{'fields'}) eq 'HASH') {
+ if ($confhash{$itemid}{'fields'}{'user'}) {
+ if ($env{'form.ltitools_userincdom_'.$i}) {
+ $confhash{$itemid}{'incdom'} = 1;
+ }
+ if ($domconfig{$action}{$itemid}{'incdom'} ne $confhash{$itemid}{'incdom'}) {
+ $changes{$itemid} = 1;
+ }
+ }
+ }
$allpos[$newpos] = $itemid;
}
if ($imgdeletions{$itemid}) {
@@ -9534,7 +9635,7 @@ sub modify_ltitools {
$resulttext .= '