version 1.1172.2.118.2.9, 2020/10/06 20:02:55
|
version 1.1172.2.118.2.13, 2021/01/03 01:47:59
|
Line 1082 sub check_for_balancer_cookie {
|
Line 1082 sub check_for_balancer_cookie {
|
return ($otherserver,$cookie); |
return ($otherserver,$cookie); |
} |
} |
|
|
|
sub updatebalcookie { |
|
my ($cookie,$balancer,$lastentry)=@_; |
|
if ($cookie =~ /^($match_domain)\_($match_username)\_[a-f0-9]{32}$/) { |
|
my ($udom,$uname) = ($1,$2); |
|
my $uprimary_id = &domain($udom,'primary'); |
|
my $uintdom = &internet_dom($uprimary_id); |
|
my $intdom = &internet_dom($balancer); |
|
my $serverhomedom = &host_domain($balancer); |
|
if (($uintdom ne '') && ($uintdom eq $intdom)) { |
|
return &reply('updatebalcookie:'.&escape($cookie).':'.&escape($lastentry),$balancer); |
|
} |
|
} |
|
return; |
|
} |
|
|
sub delbalcookie { |
sub delbalcookie { |
my ($cookie,$balancer) =@_; |
my ($cookie,$balancer) =@_; |
if ($cookie =~ /^($match_domain)\_($match_username)\_[a-f0-9]{32}$/) { |
if ($cookie =~ /^($match_domain)\_($match_username)\_[a-f0-9]{32}$/) { |
Line 1091 sub delbalcookie {
|
Line 1106 sub delbalcookie {
|
my $intdom = &internet_dom($balancer); |
my $intdom = &internet_dom($balancer); |
my $serverhomedom = &host_domain($balancer); |
my $serverhomedom = &host_domain($balancer); |
if (($uintdom ne '') && ($uintdom eq $intdom)) { |
if (($uintdom ne '') && ($uintdom eq $intdom)) { |
return &reply("delbalcookie:$cookie",$balancer); |
return &reply('delbalcookie:'.&escape($cookie),$balancer); |
} |
} |
} |
} |
} |
} |
Line 1578 sub check_loadbalancing {
|
Line 1593 sub check_loadbalancing {
|
if ($domneedscache) { |
if ($domneedscache) { |
&do_cache_new('loadbalancing',$domneedscache,$is_balancer,$cachetime); |
&do_cache_new('loadbalancing',$domneedscache,$is_balancer,$cachetime); |
} |
} |
if ($is_balancer) { |
if (($is_balancer) && ($caller ne 'switchserver')) { |
my $lowest_load = 30000; |
my $lowest_load = 30000; |
if (ref($offloadto) eq 'HASH') { |
if (ref($offloadto) eq 'HASH') { |
if (ref($offloadto->{'primary'}) eq 'ARRAY') { |
if (ref($offloadto->{'primary'}) eq 'ARRAY') { |
Line 1618 sub check_loadbalancing {
|
Line 1633 sub check_loadbalancing {
|
} |
} |
} |
} |
} |
} |
unless ($homeintdom) { |
} |
undef($setcookie); |
if (($is_balancer) && (!$homeintdom)) { |
} |
undef($setcookie); |
} |
} |
return ($is_balancer,$otherserver,$setcookie); |
return ($is_balancer,$otherserver,$setcookie); |
} |
} |
Line 4718 sub courseacclog {
|
Line 4733 sub courseacclog {
|
if ($formitem =~ /^HWFILE(?:SIZE|TOOBIG)/) { |
if ($formitem =~ /^HWFILE(?:SIZE|TOOBIG)/) { |
$what.=':'.$formitem.'='.$env{$key}; |
$what.=':'.$formitem.'='.$env{$key}; |
} elsif ($formitem !~ /^HWFILE(?:[^.]+)$/) { |
} elsif ($formitem !~ /^HWFILE(?:[^.]+)$/) { |
$what.=':'.$formitem.'='.$env{$key}; |
if ($formitem eq 'proctorpassword') { |
|
$what.=':'.$formitem.'=' . '*' x length($env{$key}); |
|
} else { |
|
$what.=':'.$formitem.'='.$env{$key}; |
|
} |
} |
} |
} |
} |
} |
} |
Line 7848 sub allowed {
|
Line 7867 sub allowed {
|
|
|
if (defined($env{'allowed.'.$priv})) { return $env{'allowed.'.$priv}; } |
if (defined($env{'allowed.'.$priv})) { return $env{'allowed.'.$priv}; } |
# Free bre access to adm and meta resources |
# Free bre access to adm and meta resources |
if (((($uri=~/^adm\//) && ($uri !~ m{/(?:smppg|bulletinboard|ext\.tool)$})) |
if (((($uri=~/^adm\//) && ($uri !~ m{/(?:smppg|bulletinboard|viewclasslist|aboutme|ext\.tool)$})) |
|| (($uri=~/\.meta$/) && ($uri!~m|^uploaded/|) )) |
|| (($uri=~/\.meta$/) && ($uri!~m|^uploaded/|) )) |
&& ($priv eq 'bre')) { |
&& ($priv eq 'bre')) { |
return 'F'; |
return 'F'; |
Line 8535 sub get_commblock_resources {
|
Line 8554 sub get_commblock_resources {
|
if ($mapsymb) { |
if ($mapsymb) { |
if (ref($navmap)) { |
if (ref($navmap)) { |
my $mapres = $navmap->getBySymb($mapsymb); |
my $mapres = $navmap->getBySymb($mapsymb); |
@to_test = $mapres->retrieveResources($mapres,undef,0,0,0,1); |
if (ref($mapres)) { |
foreach my $res (@to_test) { |
my $first = $mapres->map_start(); |
my $symb = $res->symb(); |
my $finish = $mapres->map_finish(); |
next if ($symb eq $mapsymb); |
my $it = $navmap->getIterator($first,$finish,undef,0,0); |
if ($symb ne '') { |
if (ref($it)) { |
@interval=&EXT("resource.0.interval",$symb); |
my $res; |
if ($interval[1] eq 'map') { |
while ($res = $it->next(undef,1)) { |
last; |
next unless (ref($res)); |
|
my $symb = $res->symb(); |
|
next if (($symb eq $mapsymb) || ($symb eq '')); |
|
@interval=&EXT("resource.0.interval",$symb); |
|
if ($interval[1] eq 'map') { |
|
if ($res->answerable()) { |
|
push(@to_test,$res); |
|
last; |
|
} |
|
} |
} |
} |
} |
} |
} |
} |
Line 11344 sub resdata {
|
Line 11372 sub resdata {
|
return undef; |
return undef; |
} |
} |
|
|
sub get_domain_ltitools { |
sub get_domain_lti { |
my ($cdom) = @_; |
my ($cdom,$context) = @_; |
my %ltitools; |
my ($name,%lti); |
my ($result,$cached)=&is_cached_new('ltitools',$cdom); |
if ($context eq 'consumer') { |
|
$name = 'ltitools'; |
|
} elsif ($context eq 'provider') { |
|
$name = 'lti'; |
|
} else { |
|
return %lti; |
|
} |
|
my ($result,$cached)=&is_cached_new($name,$cdom); |
if (defined($cached)) { |
if (defined($cached)) { |
if (ref($result) eq 'HASH') { |
if (ref($result) eq 'HASH') { |
%ltitools = %{$result}; |
%lti = %{$result}; |
} |
} |
} else { |
} else { |
my %domconfig = &get_dom('configuration',['ltitools'],$cdom); |
my %domconfig = &get_dom('configuration',[$name],$cdom); |
if (ref($domconfig{'ltitools'}) eq 'HASH') { |
if (ref($domconfig{$name}) eq 'HASH') { |
%ltitools = %{$domconfig{'ltitools'}}; |
%lti = %{$domconfig{$name}}; |
my %encdomconfig = &get_dom('encconfig',['ltitools'],$cdom); |
my %encdomconfig = &get_dom('encconfig',[$name],$cdom); |
if (ref($encdomconfig{'ltitools'}) eq 'HASH') { |
if (ref($encdomconfig{$name}) eq 'HASH') { |
foreach my $id (keys(%ltitools)) { |
foreach my $id (keys(%lti)) { |
if (ref($encdomconfig{'ltitools'}{$id}) eq 'HASH') { |
if (ref($encdomconfig{$name}{$id}) eq 'HASH') { |
foreach my $item ('key','secret') { |
foreach my $item ('key','secret') { |
$ltitools{$id}{$item} = $encdomconfig{'ltitools'}{$id}{$item}; |
$lti{$id}{$item} = $encdomconfig{$name}{$id}{$item}; |
} |
} |
} |
} |
} |
} |
} |
} |
} |
} |
my $cachetime = 24*60*60; |
my $cachetime = 24*60*60; |
&do_cache_new('ltitools',$cdom,\%ltitools,$cachetime); |
&do_cache_new($name,$cdom,\%lti,$cachetime); |
} |
} |
return %ltitools; |
return %lti; |
} |
} |
|
|
sub get_numsuppfiles { |
sub get_numsuppfiles { |