version 1.33, 2022/02/08 15:08:53
|
version 1.34, 2022/02/17 22:35:51
|
Line 143 sub handler {
|
Line 143 sub handler {
|
# |
# |
|
|
my ($itemid,$ltitype,%crslti,%lti_in_use); |
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) { |
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')) { |
if (($itemid) && (ref($crslti{$itemid}) eq 'HASH')) { |
$ltitype = 'c'; |
$ltitype = 'c'; |
Line 157 sub handler {
|
Line 157 sub handler {
|
return OK; |
return OK; |
} |
} |
} else { |
} else { |
$itemid = &get_lti_itemid($requri,$hostname,$params,$cdom,'','deeplink'); |
$itemid = &get_lti_itemid($requri,$hostname,$params,$cdom,'','linkprot'); |
my %lti; |
my %lti; |
if ($itemid) { |
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')) { |
if (($itemid) && (ref($lti{$itemid}) eq 'HASH')) { |
$ltitype = 'd'; |
$ltitype = 'd'; |
Line 185 sub handler {
|
Line 185 sub handler {
|
} |
} |
if ($ltiauth) { |
if ($ltiauth) { |
my $possuname; |
my $possuname; |
my $mapuser = $crslti{$itemid}{'mapuser'}; |
my $mapuser = $lti_in_use{'mapuser'}; |
if ($mapuser eq 'sourcedid') { |
if ($mapuser eq 'sourcedid') { |
if ($params->{'lis_person_sourcedid'} =~ /^$match_username$/) { |
if ($params->{'lis_person_sourcedid'} =~ /^$match_username$/) { |
$possuname = $params->{'lis_person_sourcedid'}; |
$possuname = $params->{'lis_person_sourcedid'}; |
Line 1054 sub linkprot_session {
|
Line 1054 sub linkprot_session {
|
my ($r,$uname,$cnum,$cdom,$uhome,$itemid,$ltitype,$dest,$lonhost) = @_; |
my ($r,$uname,$cnum,$cdom,$uhome,$itemid,$ltitype,$dest,$lonhost) = @_; |
$r->user($uname); |
$r->user($uname); |
if ($ltitype eq 'c') { |
if ($ltitype eq 'c') { |
&Apache::lonnet::logthis("Link Protector: $itemid (c) authorized student: $uname:$cdom, course: $cdom\_$cnum"); |
&Apache::lonnet::logthis("Course Link Protector ($itemid) authorized student: $uname:$cdom, course: $cdom\_$cnum"); |
} elsif ($ltitype eq 'd') { |
} elsif ($ltitype eq 'd') { |
&Apache::lonnet::logthis("Link Protector: $itemid (d) authorized student: $uname:$cdom, course: $cdom\_$cnum"); |
&Apache::lonnet::logthis("Domain LTI for link protection ($itemid) authorized student: $uname:$cdom, course: $cdom\_$cnum"); |
} |
} |
my ($is_balancer,$otherserver,$hosthere) = &check_balancer($r,$uname,$cdom); |
my ($is_balancer,$otherserver,$hosthere) = &check_balancer($r,$uname,$cdom); |
if (($is_balancer) && (!$hosthere)) { |
if (($is_balancer) && (!$hosthere)) { |