version 1.9, 2018/04/21 20:34:50
|
version 1.12, 2018/05/14 20:10:15
|
Line 294 sub handler {
|
Line 294 sub handler {
|
$protocol = 'https'; |
$protocol = 'https'; |
} |
} |
|
|
|
if (exists($params->{'oauth_callback'})) { |
|
$Net::OAuth::PROTOCOL_VERSION = Net::OAuth::PROTOCOL_VERSION_1_0A; |
|
} else { |
|
$Net::OAuth::PROTOCOL_VERSION = Net::OAuth::PROTOCOL_VERSION_1_0; |
|
} |
|
|
my ($itemid,$consumer_key,$secret); |
my ($itemid,$consumer_key,$secret); |
$consumer_key = $params->{'oauth_consumer_key'}; |
$consumer_key = $params->{'oauth_consumer_key'}; |
if (ref($lti_by_key{$consumer_key}) eq 'ARRAY') { |
if (ref($lti_by_key{$consumer_key}) eq 'ARRAY') { |
Line 432 sub handler {
|
Line 438 sub handler {
|
my @lcroleorder = ('cc','in','ta','ep','st'); |
my @lcroleorder = ('cc','in','ta','ep','st'); |
my @ltiroleorder = ('Instructor','TeachingAssistant','Mentor','Learner'); |
my @ltiroleorder = ('Instructor','TeachingAssistant','Mentor','Learner'); |
if ($params->{'roles'} =~ /,/) { |
if ($params->{'roles'} =~ /,/) { |
my @possltiroles = split(/\s*,\s*/,$params->{'role'}); |
my @possltiroles = split(/\s*,\s*/,$params->{'roles'}); |
foreach my $ltirole (@ltiroleorder) { |
foreach my $ltirole (@ltiroleorder) { |
if (grep(/^\Q$ltirole\E$/,@possltiroles)) { |
if (grep(/^\Q$ltirole\E$/,@possltiroles)) { |
push(@ltiroles,$ltirole); |
push(@ltiroles,$ltirole); |
Line 578 sub handler {
|
Line 584 sub handler {
|
if (($ltiroles[0] eq 'Instructor') && ($lcroles[0] eq 'cc') && ($lti{$itemid}{'mapcrs'}) && |
if (($ltiroles[0] eq 'Instructor') && ($lcroles[0] eq 'cc') && ($lti{$itemid}{'mapcrs'}) && |
($lti{$itemid}{'makecrs'})) { |
($lti{$itemid}{'makecrs'})) { |
unless (&Apache::lonnet::usertools_access($uname,$udom,'lti','reload','requestcourses')) { |
unless (&Apache::lonnet::usertools_access($uname,$udom,'lti','reload','requestcourses')) { |
&Apache::lonnet::put('environment',{ 'requestcourses.lti' => 1, },$udom,$uname); |
&Apache::lonnet::put('environment',{ 'requestcourses.lti' => 'autolimit=', },$udom,$uname); |
} |
} |
} |
} |
} else { |
} else { |
Line 892 sub lti_session {
|
Line 898 sub lti_session {
|
$env{'request.lti.rosterurl'} = $params->{'ext_ims_lis_memberships_url'}; |
$env{'request.lti.rosterurl'} = $params->{'ext_ims_lis_memberships_url'}; |
} |
} |
} |
} |
$env{'request.lti.login'} = 1; |
$env{'request.lti.login'} = $itemid; |
if ($params->{'launch_presentation_document_target'}) { |
if ($params->{'launch_presentation_document_target'}) { |
$env{'request.lti.target'} = $params->{'launch_presentation_document_target'}; |
$env{'request.lti.target'} = $params->{'launch_presentation_document_target'}; |
} |
} |
Line 916 sub lti_session {
|
Line 922 sub lti_session {
|
'domain' => $udom, |
'domain' => $udom, |
'username' => $uname, |
'username' => $uname, |
'server' => $lonhost, |
'server' => $lonhost, |
'lti.login' => 1, |
'lti.login' => $itemid, |
'lti.uri' => $tail, |
'lti.uri' => $tail, |
); |
); |
if ($role) { |
if ($role) { |
Line 984 sub invalid_request {
|
Line 990 sub invalid_request {
|
} |
} |
&Apache::lonlocal::get_language_handle($r); |
&Apache::lonlocal::get_language_handle($r); |
$r->print( |
$r->print( |
&Apache::loncommon::start_page('Invalid LTI call'). |
&Apache::loncommon::start_page('Invalid LTI call','',{ 'only_body' => 1,}). |
&mt('Invalid LTI call [_1]',$num). |
&mt('Invalid LTI call [_1]',$num). |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
return; |
return; |