version 1.22, 2021/08/07 20:11:53
|
version 1.26, 2021/11/22 23:41:00
|
Line 197 sub handler {
|
Line 197 sub handler {
|
delete($env{'form.'.$key}); |
delete($env{'form.'.$key}); |
} |
} |
my $ltoken = &Apache::lonnet::tmpput({'linkprot' => $itemid.$ltitype.':'.$tail}, |
my $ltoken = &Apache::lonnet::tmpput({'linkprot' => $itemid.$ltitype.':'.$tail}, |
$lonhost); |
$lonhost,'link'); |
if ($ltoken) { |
if ($ltoken) { |
$r->internal_redirect($tail.'?ltoken='.$ltoken); |
$r->internal_redirect($tail.'?ltoken='.$ltoken); |
$r->set_handlers('PerlHandler'=> undef); |
$r->set_handlers('PerlHandler'=> undef); |
Line 613 sub handler {
|
Line 613 sub handler {
|
|
|
my $reqcrs; |
my $reqcrs; |
if ($cnum eq '') { |
if ($cnum eq '') { |
if ((@ltiroles) && ($lti{$itemid}{'mapcrs'}) && |
if ($lti{$itemid}{'crsinc'}) { |
($ltiroles[0] eq 'Instructor') && ($lcroles[0] eq 'cc') && ($lti{$itemid}{'makecrs'})) { |
if ((@ltiroles) && ($lti{$itemid}{'mapcrs'}) && |
my (%can_request,%request_domains); |
($ltiroles[0] eq 'Instructor') && ($lcroles[0] eq 'cc') && ($lti{$itemid}{'makecrs'})) { |
&Apache::lonnet::check_can_request($cdom,\%can_request,\%request_domains,$uname,$udom); |
my (%can_request,%request_domains); |
if ($can_request{'lti'}) { |
&Apache::lonnet::check_can_request($cdom,\%can_request,\%request_domains,$uname,$udom); |
$reqcrs = 1; |
if ($can_request{'lti'}) { |
<i_session($r,$itemid,$uname,$udom,$uhome,$lonhost,undef,$mapurl,$tail, |
$reqcrs = 1; |
$symb,$cdom,$cnum,$params,\@ltiroles,$lti{$itemid},\@lcroles, |
<i_session($r,$itemid,$uname,$udom,$uhome,$lonhost,undef,$mapurl,$tail, |
$reqcrs,$sourcecrs); |
$symb,$cdom,$cnum,$params,\@ltiroles,$lti{$itemid},\@lcroles, |
|
$reqcrs,$sourcecrs); |
|
} else { |
|
&invalid_request($r,27); |
|
} |
} else { |
} else { |
&invalid_request($r,27); |
&invalid_request($r,28); |
} |
} |
} else { |
} else { |
&invalid_request($r,28); |
<i_session($r,$itemid,$uname,$udom,$uhome,$lonhost,undef,$mapurl,$tail, |
|
$symb,$cdom,$cnum,$params,\@ltiroles,$lti{$itemid},\@lcroles, |
|
$reqcrs,$sourcecrs); |
} |
} |
return OK; |
return OK; |
} |
} |
Line 854 sub lti_session {
|
Line 860 sub lti_session {
|
my $lowest_load; |
my $lowest_load; |
($otherserver,undef,undef,undef,$lowest_load) = &Apache::lonnet::choose_server($udom); |
($otherserver,undef,undef,undef,$lowest_load) = &Apache::lonnet::choose_server($udom); |
if ($lowest_load > 100) { |
if ($lowest_load > 100) { |
$otherserver = &Apache::lonnet::spareserver($lowest_load,$lowest_load,1,$udom); |
$otherserver = &Apache::lonnet::spareserver($r,$lowest_load,$lowest_load,1,$udom); |
} |
} |
} |
} |
if ($otherserver ne '') { |
if ($otherserver ne '') { |
Line 894 sub lti_session {
|
Line 900 sub lti_session {
|
$env{'request.lti.uri'} = $tail; |
$env{'request.lti.uri'} = $tail; |
} else { |
} else { |
unless ($tail eq '/adm/roles') { |
unless ($tail eq '/adm/roles') { |
$env{'form.origurl'} = '/adm/navmaps'; |
if ($cnum) { |
|
$env{'form.origurl'} = '/adm/navmaps'; |
|
} |
} |
} |
} |
} |
} |
} |
Line 930 sub lti_session {
|
Line 938 sub lti_session {
|
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'}; |
} |
} |
foreach my $key (%{$params}) { |
foreach my $key (keys(%{$params})) { |
delete($env{'form.'.$key}); |
delete($env{'form.'.$key}); |
} |
} |
my $redirecturl = '/adm/switchserver'; |
my $redirecturl = '/adm/switchserver'; |
Line 942 sub lti_session {
|
Line 950 sub lti_session {
|
} else { |
} else { |
# need to login them in, so generate the need data that |
# need to login them in, so generate the need data that |
# migrate expects to do login |
# migrate expects to do login |
foreach my $key (%{$params}) { |
foreach my $key (keys(%{$params})) { |
delete($env{'form.'.$key}); |
delete($env{'form.'.$key}); |
} |
} |
if (($ltihash->{'callback'}) && ($params->{$ltihash->{'callback'}})) { |
if (($ltihash->{'callback'}) && ($params->{$ltihash->{'callback'}})) { |
Line 1002 sub lti_session {
|
Line 1010 sub lti_session {
|
$info{'origurl'} = $tail; |
$info{'origurl'} = $tail; |
} else { |
} else { |
unless ($tail eq '/adm/roles') { |
unless ($tail eq '/adm/roles') { |
$info{'origurl'} = '/adm/navmaps'; |
if ($cnum) { |
|
$info{'origurl'} = '/adm/navmaps'; |
|
} |
} |
} |
} |
} |
} |
} |