--- loncom/interface/lontiny.pm 2024/02/09 20:08:16 1.21 +++ loncom/interface/lontiny.pm 2024/02/10 14:12:32 1.22 @@ -2,7 +2,7 @@ # Extract domain, courseID, and symb from a shortened URL, # and switch role to a role in designated course. # -# $Id: lontiny.pm,v 1.21 2024/02/09 20:08:16 raeburn Exp $ +# $Id: lontiny.pm,v 1.22 2024/02/10 14:12:32 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -440,35 +440,48 @@ sub launch_check { } } } else { - if (($currdeeplinklogin ne $linkuri) || - (($prevlaunch ne '') && ($currdeeplinklogin ne $prevlaunch))) { + unless ($currdeeplinklogin eq $linkuri) { if (($linkprotector) || ($linkkey ne '')) { - if ($linkprotector) { - &Apache::lonnet::appenv({'request.linkprot' => $linkprotector.':'.$linkproturi}); - } elsif ($env{'request.linkprot'}) { - &Apache::lonnet::delenv('request.linkprot'); - } + $newlauncher = 1; + } + } + if ($linkprotector) { + &Apache::lonnet::appenv({'request.linkprot' => $linkprotector.':'.$linkproturi}); + } elsif ($env{'request.linkprot'}) { + &Apache::lonnet::delenv('request.linkprot'); + } + if ($linkkey ne '') { + &Apache::lonnet::appenv({'request.linkkey' => $linkkey}); + } elsif ($env{'request.linkkey'} ne '') { + &Apache::lonnet::delenv('request.linkkey'); + } + if (($linkprotector) || ($linkkey ne '')) { + if ($linkprotexit ne $env{'request.linkprotexit'}) { if ($linkprotexit) { &Apache::lonnet::appenv({'request.linkprotexit' => $linkprotexit}); } elsif ($env{'request.linkprotexit'}) { &Apache::lonnet::delenv('request.linkprotexit'); } + } + if ($linkprotpbid ne $env{'request.linkprotpbid'}) { if ($linkprotpbid) { &Apache::lonnet::appenv({'request.linkprotpbid' => $linkprotpbid}); } elsif ($env{'request.linkprotpbid'}) { &Apache::lonnet::delenv('request.linkprotpbid'); } + } + if ($linkprotpburl ne $env{'request.linkprotpburl'}) { if ($linkprotpburl) { &Apache::lonnet::appenv({'request.linkprotpburl' => $linkprotpburl}); } elsif ($env{'request.linkprotpburl'}) { &Apache::lonnet::delenv('request.linkprotpburl'); } - if ($linkkey ne '') { - &Apache::lonnet::appenv({'request.linkkey' => $linkkey}); - } elsif ($env{'request.linkkey'} ne '') { - &Apache::lonnet::delenv('request.linkkey'); + } + } elsif ($prevlaunch) { + foreach my $requestkey ('linkprotpbid','linkprotpburl','linkprotexit') { + if ($env{"request.$requestkey"}) { + &Apache::lonnet::delenv("request.$requestkey"); } - $newlauncher = 1; } } &Apache::lonnet::appenv({'request.deeplink.login' => $linkuri});