version 1.38, 2022/06/26 04:03:48
|
version 1.39, 2022/06/30 21:04:14
|
Line 175 sub handler {
|
Line 175 sub handler {
|
} |
} |
} |
} |
} |
} |
|
my $exiturl; |
|
if (($itemid) && ($lti_in_use{'returnurl'} ne '')) { |
|
if (exists($params->{$lti_in_use{'returnurl'}})) { |
|
$exiturl = $params->{$lti_in_use{'returnurl'}}; |
|
} elsif (exists($params->{'custom_'.$lti_in_use{'returnurl'}})) { |
|
$exiturl = $params->{'custom_'.$lti_in_use{'returnurl'}}; |
|
} |
|
} |
if (($itemid) && ($lti_in_use{'requser'})) { |
if (($itemid) && ($lti_in_use{'requser'})) { |
my %courseinfo = &Apache::lonnet::coursedescription($cdom.'_'.$cnum); |
my %courseinfo = &Apache::lonnet::coursedescription($cdom.'_'.$cnum); |
my $ltiauth; |
my $ltiauth; |
Line 225 sub handler {
|
Line 233 sub handler {
|
foreach my $key (%{$params}) { |
foreach my $key (%{$params}) { |
delete($env{'form.'.$key}); |
delete($env{'form.'.$key}); |
} |
} |
&linkprot_session($r,$uname,$cnum,$cdom,$uhome,$itemid,$ltitype,$tail,$lonhost); |
&linkprot_session($r,$uname,$cnum,$cdom,$uhome,$itemid,$ltitype,$tail,$lonhost,$exiturl); |
return OK; |
return OK; |
} |
} |
} |
} |
Line 248 sub handler {
|
Line 256 sub handler {
|
if ($ltiuser ne '') { |
if ($ltiuser ne '') { |
$info{'linkprotuser'} = $ltiuser; |
$info{'linkprotuser'} = $ltiuser; |
} |
} |
|
if ($exiturl ne '') { |
|
$info{'linkprotexit'} = $exiturl; |
|
} |
my $ltoken = &Apache::lonnet::tmpput(\%info,$lonhost,'link'); |
my $ltoken = &Apache::lonnet::tmpput(\%info,$lonhost,'link'); |
if (($ltoken eq 'con_lost') || ($ltoken eq 'refused') || ($ltoken =~ /^error:/) || |
if (($ltoken eq 'con_lost') || ($ltoken eq 'refused') || ($ltoken =~ /^error:/) || |
($ltoken eq 'unknown_cmd') || ($ltoken eq 'no_such_host') || |
($ltoken eq 'unknown_cmd') || ($ltoken eq 'no_such_host') || |
Line 1061 sub lti_session {
|
Line 1072 sub lti_session {
|
} |
} |
|
|
sub linkprot_session { |
sub linkprot_session { |
my ($r,$uname,$cnum,$cdom,$uhome,$itemid,$ltitype,$dest,$lonhost) = @_; |
my ($r,$uname,$cnum,$cdom,$uhome,$itemid,$ltitype,$dest,$lonhost,$exiturl) = @_; |
$r->user($uname); |
$r->user($uname); |
if ($ltitype eq 'c') { |
if ($ltitype eq 'c') { |
&Apache::lonnet::logthis("Course Link Protector ($itemid) authorized student: $uname:$cdom, course: $cdom\_$cnum"); |
&Apache::lonnet::logthis("Course Link Protector ($itemid) authorized student: $uname:$cdom, course: $cdom\_$cnum"); |
Line 1076 sub linkprot_session {
|
Line 1087 sub linkprot_session {
|
$env{'request.linkprot'} = $itemid.$ltitype.':'.$dest; |
$env{'request.linkprot'} = $itemid.$ltitype.':'.$dest; |
$env{'request.linkprotuser'} = $uname.':'.$cdom; |
$env{'request.linkprotuser'} = $uname.':'.$cdom; |
$env{'request.deeplink.login'} = $dest; |
$env{'request.deeplink.login'} = $dest; |
|
if ($exiturl ne '') { |
|
$env{'request.linkprotexit'} = $exiturl; |
|
} |
my $redirecturl = '/adm/switchserver'; |
my $redirecturl = '/adm/switchserver'; |
if ($otherserver ne '') { |
if ($otherserver ne '') { |
$redirecturl .= '?otherserver='.$otherserver; |
$redirecturl .= '?otherserver='.$otherserver; |
Line 1095 sub linkprot_session {
|
Line 1109 sub linkprot_session {
|
'origurl' => $dest, |
'origurl' => $dest, |
'deeplink.login' => $dest, |
'deeplink.login' => $dest, |
); |
); |
|
if ($exiturl ne '') { |
|
$info{'linkprotexit'} = $exiturl; |
|
} |
my $token = &Apache::lonnet::tmpput(\%info,$lonhost); |
my $token = &Apache::lonnet::tmpput(\%info,$lonhost); |
$env{'form.token'} = $token; |
$env{'form.token'} = $token; |
$r->internal_redirect('/adm/migrateuser'); |
$r->internal_redirect('/adm/migrateuser'); |