--- loncom/lontrans.pm 2018/01/13 18:58:33 1.19 +++ loncom/lontrans.pm 2018/04/14 02:29:51 1.20 @@ -1,7 +1,7 @@ # The LearningOnline Network # URL translation for User Files # -# $Id: lontrans.pm,v 1.19 2018/01/13 18:58:33 raeburn Exp $ +# $Id: lontrans.pm,v 1.20 2018/04/14 02:29:51 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -44,15 +44,27 @@ sub handler { my $handle = &Apache::lonnet::check_for_valid_session($r,undef,\%user); if (($handle ne '') && ($user{'lti'})) { if ($realuri =~ m{^uploaded/$match_domain/$match_courseid/(default|supplemental)(|_\d+)\.(?:sequence|page)___\d+___.+$}) { + if ($user{'ltiuri'} ne $realuri) { + &Apache::lonnet::appenv({'request.lti.uri' => $realuri}); + } my ($map,$resid,$url) = split(/___/,$realuri); $realuri = &Apache::lonnet::clutter($url).'?symb='.$realuri; } elsif ($realuri =~ m{^tiny/$match_domain/\w+$}) { - $realuri = '/'.$realuri; + $realuri = '/'.$realuri; + if ($user{'ltiuri'} ne $realuri) { + &Apache::lonnet::appenv({'request.lti.uri' => $realuri}); + } } elsif ($realuri =~ m{($match_domain)/($match_courseid)$}) { $realuri = '/adm/navmaps'; + if ($user{'ltiuri'} ne '') { + &Apache::lonnet::delenv('request.lti.uri'); + } } else { $realuri = '/'.$realuri; if ($realuri =~ m{/default_\d+\.sequence$}) { + if ($user{'ltiuri'} ne $realuri) { + &Apache::lonnet::appenv({'request.lti.uri' => $realuri}); + } $realuri .= (($realuri =~/\?/)?'&':'?').'navmap=1'; } }