--- loncom/lti/ltiauth.pm 2018/05/30 18:06:13 1.14 +++ loncom/lti/ltiauth.pm 2018/08/14 21:03:39 1.16 @@ -1,7 +1,7 @@ # The LearningOnline Network # Basic LTI Authentication Module # -# $Id: ltiauth.pm,v 1.14 2018/05/30 18:06:13 raeburn Exp $ +# $Id: ltiauth.pm,v 1.16 2018/08/14 21:03:39 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -205,14 +205,14 @@ sub handler { $mapurl = $tail; } else { $symb = $tail; - $symb =~ s{^/+}{}; + $symb =~ s{^/}{}; } } elsif ($tail =~ m{^/res/(?:$match_domain)/(?:$match_username)/.+\.(?:sequence|page)(|___\d+___.+)$}) { if ($1 eq '') { $mapurl = $tail; } else { $symb = $tail; - $symb =~ s{^/+}{}; + $symb =~ s{^/res/}{}; } } elsif ($tail =~ m{^/($match_domain)/($match_courseid)$}) { ($urlcdom,$urlcnum) = ($1,$2); @@ -435,9 +435,10 @@ sub handler { my (@ltiroles,@lcroles); my @lcroleorder = ('cc','in','ta','ep','st'); - my ($lcrolesref,$ltirolesref) = &LONCAPA::ltiutils::get_lc_roles($params->{'roles'}, - \@lcroleorder, - $lti{$itemid}{maproles}); + my ($lcrolesref,$ltirolesref) = + &LONCAPA::ltiutils::get_lc_roles($params->{'roles'}, + \@lcroleorder, + $lti{$itemid}{maproles}); if (ref($lcrolesref) eq 'ARRAY') { @lcroles = @{$lcrolesref}; } @@ -729,7 +730,7 @@ sub lti_session { &Apache::lonauth::success($r,$uname,$udom,$uhome,'noredirect'); if ($symb) { $env{'form.symb'} = $symb; - $env{'request.lti.uri'} = $symb; + $env{'request.lti.uri'} = $tail; } else { if ($mapurl) { $env{'form.origurl'} = $mapurl;