--- loncom/lti/ltiauth.pm 2022/02/06 21:37:00 1.32 +++ loncom/lti/ltiauth.pm 2022/02/17 22:35:51 1.34 @@ -1,7 +1,7 @@ # The LearningOnline Network # Basic LTI Authentication Module # -# $Id: ltiauth.pm,v 1.32 2022/02/06 21:37:00 raeburn Exp $ +# $Id: ltiauth.pm,v 1.34 2022/02/17 22:35:51 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -143,9 +143,9 @@ sub handler { # my ($itemid,$ltitype,%crslti,%lti_in_use); - $itemid = &get_lti_itemid($requri,$hostname,$params,$cdom,$cnum,'deeplink'); + $itemid = &get_lti_itemid($requri,$hostname,$params,$cdom,$cnum,'linkprot'); if ($itemid) { - %crslti = &Apache::lonnet::get_course_lti($cnum,$cdom,'provider'); + %crslti = &Apache::lonnet::get_course_lti($cnum,$cdom); } if (($itemid) && (ref($crslti{$itemid}) eq 'HASH')) { $ltitype = 'c'; @@ -157,10 +157,10 @@ sub handler { return OK; } } else { - $itemid = &get_lti_itemid($requri,$hostname,$params,$cdom,'','deeplink'); + $itemid = &get_lti_itemid($requri,$hostname,$params,$cdom,'','linkprot'); my %lti; if ($itemid) { - %lti = &Apache::lonnet::get_domain_lti($cdom,'provider'); + %lti = &Apache::lonnet::get_domain_lti($cdom,'linkprot'); } if (($itemid) && (ref($lti{$itemid}) eq 'HASH')) { $ltitype = 'd'; @@ -185,7 +185,7 @@ sub handler { } if ($ltiauth) { my $possuname; - my $mapuser = $crslti{$itemid}{'mapuser'}; + my $mapuser = $lti_in_use{'mapuser'}; if ($mapuser eq 'sourcedid') { if ($params->{'lis_person_sourcedid'} =~ /^$match_username$/) { $possuname = $params->{'lis_person_sourcedid'}; @@ -1061,6 +1061,7 @@ sub linkprot_session { my ($is_balancer,$otherserver,$hosthere) = &check_balancer($r,$uname,$cdom); if (($is_balancer) && (!$hosthere)) { # login but immediately go to switch server + &Apache::lonauth::success($r,$uname,$cdom,$uhome,'noredirect'); $env{'form.origurl'} = $dest; $env{'request.linkprot'} = $itemid.$ltitype.':'.$dest; $env{'request.deeplink.login'} = $dest; @@ -1128,7 +1129,7 @@ sub invalid_request { &mt('Launch of LON-CAPA is unavailable from the "external tool" link you had followed in another web application.'). &mt('Launch failed for the following reason:'). '

'. - '

'.$msga'.

'. + '

'.$msg.'

'. &Apache::loncommon::end_page()); return; }