version 1.1172.2.126, 2020/09/28 13:56:29
|
version 1.1172.2.127, 2020/10/01 10:24:06
|
Line 8029 sub allowed {
|
Line 8029 sub allowed {
|
if ($noblockcheck) { |
if ($noblockcheck) { |
$thisallowed='F'; |
$thisallowed='F'; |
} else { |
} else { |
my @blockers = &has_comm_blocking($priv,$symb,$refuri,$ignorecache); |
my @blockers = &has_comm_blocking($priv,'',$refuri,'',1); |
if (@blockers > 0) { |
if (@blockers > 0) { |
$thisallowed = 'B'; |
$thisallowed = 'B'; |
} else { |
} else { |
Line 8144 sub allowed {
|
Line 8144 sub allowed {
|
if ($noblockcheck) { |
if ($noblockcheck) { |
$thisallowed.=$value; |
$thisallowed.=$value; |
} else { |
} else { |
my @blockers = &has_comm_blocking($priv,'',$refuri,$ignorecache); |
my @blockers = &has_comm_blocking($priv,'',$refuri,'',1); |
if (@blockers > 0) { |
if (@blockers > 0) { |
$thisallowed = 'B'; |
$thisallowed = 'B'; |
} else { |
} else { |
Line 8553 sub get_commblock_resources {
|
Line 8553 sub get_commblock_resources {
|
} |
} |
|
|
sub has_comm_blocking { |
sub has_comm_blocking { |
my ($priv,$symb,$uri,$nosymbcache,$blocked,$blocks) = @_; |
my ($priv,$symb,$uri,$nosymbcache,$noenccheck,$blocked,$blocks) = @_; |
my @blockers; |
my @blockers; |
return unless ($env{'request.course.id'}); |
return unless ($env{'request.course.id'}); |
return unless ($priv eq 'bre'); |
return unless ($priv eq 'bre'); |
Line 8563 sub has_comm_blocking {
|
Line 8563 sub has_comm_blocking {
|
return unless (keys(%cachedblockers) > 0); |
return unless (keys(%cachedblockers) > 0); |
my (%possibles,@symbs); |
my (%possibles,@symbs); |
if (!$symb) { |
if (!$symb) { |
$symb = &symbread($uri,1,1,'',\%possibles,$nosymbcache); |
$symb = &symbread($uri,1,1,1,\%possibles,$nosymbcache,$noenccheck); |
} |
} |
if ($symb) { |
if ($symb) { |
@symbs = ($symb); |
@symbs = ($symb); |
Line 12445 sub deversion {
|
Line 12445 sub deversion {
|
|
|
sub symbread { |
sub symbread { |
my ($thisfn,$donotrecurse,$ignorecachednull,$checkforblock,$possibles, |
my ($thisfn,$donotrecurse,$ignorecachednull,$checkforblock,$possibles, |
$nocache)=@_; |
$nocache,$noenccheck)=@_; |
my $cache_str='request.symbread.cached.'.$thisfn; |
my $cache_str='request.symbread.cached.'.$thisfn; |
if (defined($env{$cache_str}) && !$nocache) { |
if (defined($env{$cache_str}) && !$nocache) { |
unless (ref($possibles) eq 'HASH') { |
unless (ref($possibles) eq 'HASH') { |
Line 12497 sub symbread {
|
Line 12497 sub symbread {
|
untie(%hash); |
untie(%hash); |
} |
} |
if ($syval) { |
if ($syval) { |
my @blockers = &has_comm_blocking('bre',$syval,$thisfn,$nocache); |
my @blockers = &has_comm_blocking('bre',$syval,$thisfn,$nocache,$noenccheck); |
if (@blockers) { |
if (@blockers) { |
$syval=''; |
$syval=''; |
} |
} |
Line 12540 sub symbread {
|
Line 12540 sub symbread {
|
} |
} |
if ($checkforblock) { |
if ($checkforblock) { |
unless ($bighash{'randomout_'.$ids} || $env{'request.role.adv'}) { |
unless ($bighash{'randomout_'.$ids} || $env{'request.role.adv'}) { |
my @blockers = &has_comm_blocking('bre',$syval,$bighash{'src_'.$ids}); |
my @blockers = &has_comm_blocking('bre',$syval,$bighash{'src_'.$ids},'',$noenccheck); |
if (@blockers) { |
if (@blockers) { |
$syval = ''; |
$syval = ''; |
untie(%bighash); |
untie(%bighash); |
Line 12566 sub symbread {
|
Line 12566 sub symbread {
|
my $poss_syval=&encode_symb($bighash{'map_id_'.$mapid}, |
my $poss_syval=&encode_symb($bighash{'map_id_'.$mapid}, |
$resid,$thisfn); |
$resid,$thisfn); |
next if ($bighash{'randomout_'.$id} && !$env{'request.role.adv'}); |
next if ($bighash{'randomout_'.$id} && !$env{'request.role.adv'}); |
next unless ($bighash{'encrypted_'.$id} eq $env{'request.enc'}); |
next unless (($noenccheck) || ($bighash{'encrypted_'.$id} eq $env{'request.enc'})); |
if ($checkforblock) { |
if ($checkforblock) { |
my @blockers = &has_comm_blocking('bre',$poss_syval,$file); |
my @blockers = &has_comm_blocking('bre',$poss_syval,$file,'',$noenccheck); |
if (@blockers > 0) { |
if (@blockers > 0) { |
$syval = ''; |
$syval = ''; |
} else { |
} else { |