[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /lonnet/perl lonnet.pm

raeburn raeburn at source.lon-capa.org
Thu Oct 1 06:24:06 EDT 2020


raeburn		Thu Oct  1 10:24:06 2020 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - For 2.11
    Backport 1.1426
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1172.2.126 loncom/lonnet/perl/lonnet.pm:1.1172.2.127
--- loncom/lonnet/perl/lonnet.pm:1.1172.2.126	Mon Sep 28 13:56:29 2020
+++ loncom/lonnet/perl/lonnet.pm	Thu Oct  1 10:24:06 2020
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1172.2.126 2020/09/28 13:56:29 raeburn Exp $
+# $Id: lonnet.pm,v 1.1172.2.127 2020/10/01 10:24:06 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -8029,7 +8029,7 @@
                         if ($noblockcheck) {
                             $thisallowed='F';
                         } else {
-                            my @blockers = &has_comm_blocking($priv,$symb,$refuri,$ignorecache);
+                            my @blockers = &has_comm_blocking($priv,'',$refuri,'',1);
                             if (@blockers > 0) {
                                 $thisallowed = 'B';
                             } else {
@@ -8144,7 +8144,7 @@
                       if ($noblockcheck) {
                           $thisallowed.=$value;
                       } else {
-                          my @blockers = &has_comm_blocking($priv,'',$refuri,$ignorecache);
+                          my @blockers = &has_comm_blocking($priv,'',$refuri,'',1);
                           if (@blockers > 0) {
                               $thisallowed = 'B';
                           } else {
@@ -8553,7 +8553,7 @@
 }
 
 sub has_comm_blocking {
-    my ($priv,$symb,$uri,$nosymbcache,$blocked,$blocks) = @_;
+    my ($priv,$symb,$uri,$nosymbcache,$noenccheck,$blocked,$blocks) = @_;
     my @blockers;
     return unless ($env{'request.course.id'});
     return unless ($priv eq 'bre');
@@ -8563,7 +8563,7 @@
     return unless (keys(%cachedblockers) > 0);
     my (%possibles, at symbs);
     if (!$symb) {
-        $symb = &symbread($uri,1,1,'',\%possibles,$nosymbcache);
+        $symb = &symbread($uri,1,1,1,\%possibles,$nosymbcache,$noenccheck);
     }
     if ($symb) {
         @symbs = ($symb);
@@ -12445,7 +12445,7 @@
 
 sub symbread {
     my ($thisfn,$donotrecurse,$ignorecachednull,$checkforblock,$possibles,
-        $nocache)=@_;
+        $nocache,$noenccheck)=@_;
     my $cache_str='request.symbread.cached.'.$thisfn;
     if (defined($env{$cache_str}) && !$nocache) {
         unless (ref($possibles) eq 'HASH') {
@@ -12497,7 +12497,7 @@
                 untie(%hash);
             }
             if ($syval) {
-                my @blockers = &has_comm_blocking('bre',$syval,$thisfn,$nocache);
+                my @blockers = &has_comm_blocking('bre',$syval,$thisfn,$nocache,$noenccheck);
                 if (@blockers) {
                     $syval='';
                 }
@@ -12540,7 +12540,7 @@
                      }
                      if ($checkforblock) {
                          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) {
                                  $syval = '';
                                  untie(%bighash);
@@ -12566,9 +12566,9 @@
                                  my $poss_syval=&encode_symb($bighash{'map_id_'.$mapid},
                                                              $resid,$thisfn);
                                  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) {
-                                     my @blockers = &has_comm_blocking('bre',$poss_syval,$file);
+                                     my @blockers = &has_comm_blocking('bre',$poss_syval,$file,'',$noenccheck);
                                      if (@blockers > 0) {
                                          $syval = '';
                                      } else {




More information about the LON-CAPA-cvs mailing list