From raeburn at source.lon-capa.org Mon Sep 28 09:08:57 2020 From: raeburn at source.lon-capa.org (raeburn) Date: Mon, 28 Sep 2020 13:08:57 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm Message-ID: raeburn Mon Sep 28 13:08:57 2020 EDT Modified files: /loncom/lonnet/perl lonnet.pm Log: - Untie hash and set $env{$cache_str} on early return from symbread subroutine. Index: loncom/lonnet/perl/lonnet.pm diff -u loncom/lonnet/perl/lonnet.pm:1.1424 loncom/lonnet/perl/lonnet.pm:1.1425 --- loncom/lonnet/perl/lonnet.pm:1.1424 Mon Sep 28 00:10:29 2020 +++ loncom/lonnet/perl/lonnet.pm Mon Sep 28 13:08:57 2020 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1424 2020/09/28 00:10:29 raeburn Exp $ +# $Id: lonnet.pm,v 1.1425 2020/09/28 13:08:57 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -13408,7 +13408,9 @@ my @blockers = &has_comm_blocking('bre',$syval,$bighash{'src_'.$ids}); if (@blockers) { $syval = ''; - return; + untie(%bighash); + return '' if ($nocache); + return $env{$cache_str}=''; } } } From raeburn at source.lon-capa.org Mon Sep 28 09:56:30 2020 From: raeburn at source.lon-capa.org (raeburn) Date: Mon, 28 Sep 2020 13:56:30 -0000 Subject: [LON-CAPA-cvs] cvs: loncom(version_2_11_X) /lonnet/perl lonnet.pm Message-ID: raeburn Mon Sep 28 13:56:30 2020 EDT Modified files: (Branch: version_2_11_X) /loncom/lonnet/perl lonnet.pm Log: - For 2.11 Backport 1.1424, 1.1425 -------------- next part -------------- Index: loncom/lonnet/perl/lonnet.pm diff -u loncom/lonnet/perl/lonnet.pm:1.1172.2.125 loncom/lonnet/perl/lonnet.pm:1.1172.2.126 --- loncom/lonnet/perl/lonnet.pm:1.1172.2.125 Tue Sep 8 01:19:47 2020 +++ loncom/lonnet/perl/lonnet.pm Mon Sep 28 13:56:29 2020 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1172.2.125 2020/09/08 01:19:47 raeburn Exp $ +# $Id: lonnet.pm,v 1.1172.2.126 2020/09/28 13:56:29 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -7784,7 +7784,7 @@ # ------------------------------------------------- Check for a user privilege sub allowed { - my ($priv,$uri,$symb,$role,$clientip,$noblockcheck)=@_; + my ($priv,$uri,$symb,$role,$clientip,$noblockcheck,$ignorecache)=@_; my $ver_orguri=$uri; $uri=&deversion($uri); my $orguri=$uri; @@ -8009,7 +8009,7 @@ if ($noblockcheck) { $thisallowed.=$value; } else { - my @blockers = &has_comm_blocking($priv,$symb,$uri); + my @blockers = &has_comm_blocking($priv,$symb,$uri,$ignorecache); if (@blockers > 0) { $thisallowed = 'B'; } else { @@ -8029,7 +8029,7 @@ if ($noblockcheck) { $thisallowed='F'; } else { - my @blockers = &has_comm_blocking($priv,$symb,$refuri); + my @blockers = &has_comm_blocking($priv,$symb,$refuri,$ignorecache); if (@blockers > 0) { $thisallowed = 'B'; } else { @@ -8102,7 +8102,7 @@ if ($noblockcheck) { $thisallowed.=$value; } else { - my @blockers = &has_comm_blocking($priv,$symb,$uri); + my @blockers = &has_comm_blocking($priv,$symb,$uri,$ignorecache); if (@blockers > 0) { $thisallowed = 'B'; } else { @@ -8115,7 +8115,7 @@ $checkreferer=0; } } - + if ($checkreferer) { my $refuri=$env{'httpref.'.$orguri}; unless ($refuri) { @@ -8144,7 +8144,7 @@ if ($noblockcheck) { $thisallowed.=$value; } else { - my @blockers = &has_comm_blocking($priv,$symb,$refuri); + my @blockers = &has_comm_blocking($priv,'',$refuri,$ignorecache); if (@blockers > 0) { $thisallowed = 'B'; } else { @@ -8230,7 +8230,7 @@ } } } - + # # Rest of the restrictions depend on selected course # @@ -8388,6 +8388,10 @@ # # User for whom data are being temporarily cached. my $cacheduser=''; +# Course for which data are being temporarily cached. +my $cachedcid=''; +# List of blocks passed to &get_commblock_resources(); +my $cachedblocks=''; # Cached blockers for this user (a hash of blocking items). my %cachedblockers=(); # When the data were last cached. @@ -8397,13 +8401,22 @@ my ($uname,$udom,$blocks)=@_; if (($uname ne '') && ($udom ne '')) { if (($cacheduser eq $uname.':'.$udom) && - (abs($cachedlast-time)<5)) { + ($cachedcid eq $env{'request.course.id'}) && + (abs($cachedlast-time)<5) && + (((ref($blocks) eq 'HASH') && + ($cachedblocks eq join(',',sort(keys(%{$blocks}))))) || + (!ref($blocks) && $cachedblocks eq ''))) { return; } } $cachedlast=time; $cacheduser=$uname.':'.$udom; + $cachedcid=$env{'request.course.id'}; %cachedblockers = &get_commblock_resources($blocks); + if ((ref($blocks) eq 'HASH') && (keys(%{$blocks}) > 0)) { + $cachedblocks = join(',',sort(keys(%{$blocks}))); + } + return; } sub get_comm_blocks { @@ -8540,7 +8553,7 @@ } sub has_comm_blocking { - my ($priv,$symb,$uri,$blocks) = @_; + my ($priv,$symb,$uri,$nosymbcache,$blocked,$blocks) = @_; my @blockers; return unless ($env{'request.course.id'}); return unless ($priv eq 'bre'); @@ -8550,7 +8563,7 @@ return unless (keys(%cachedblockers) > 0); my (%possibles, at symbs); if (!$symb) { - $symb = &symbread($uri,1,1,1,\%possibles); + $symb = &symbread($uri,1,1,'',\%possibles,$nosymbcache); } if ($symb) { @symbs = ($symb); @@ -8564,9 +8577,11 @@ foreach my $block (keys(%cachedblockers)) { if ($block =~ /^firstaccess____(.+)$/) { my $item = $1; - if (($item eq $map) || ($item eq $symb)) { - $noblock = 1; - last; + unless ($blocked) { + if (($item eq $map) || ($item eq $symb)) { + $noblock = 1; + last; + } } } if (ref($cachedblockers{$block}) eq 'HASH') { @@ -8577,18 +8592,20 @@ } } } - } - if (ref($cachedblockers{$block}{'maps'}) eq 'HASH') { - if ($cachedblockers{$block}{'maps'}{$map}) { - unless (grep(/^\Q$block\E$/, at blockers)) { - push(@blockers,$block); + if (ref($cachedblockers{$block}{'maps'}) eq 'HASH') { + if ($cachedblockers{$block}{'maps'}{$map}) { + unless (grep(/^\Q$block\E$/, at blockers)) { + push(@blockers,$block); + } } } } } } - return if ($noblock); - return @blockers; + unless ($noblock) { + return @blockers; + } + return; } } @@ -12427,19 +12444,26 @@ # ------------------------------------------------------ Return symb list entry sub symbread { - my ($thisfn,$donotrecurse,$ignorecachednull,$checkforblock,$possibles)=@_; + my ($thisfn,$donotrecurse,$ignorecachednull,$checkforblock,$possibles, + $nocache)=@_; my $cache_str='request.symbread.cached.'.$thisfn; - if (defined($env{$cache_str})) { - if ($ignorecachednull) { - return $env{$cache_str} unless ($env{$cache_str} eq ''); - } else { - return $env{$cache_str}; + if (defined($env{$cache_str}) && !$nocache) { + unless (ref($possibles) eq 'HASH') { + if ($ignorecachednull) { + return $env{$cache_str} unless ($env{$cache_str} eq ''); + } else { + return $env{$cache_str}; + } } } # no filename provided? try from environment unless ($thisfn) { if ($env{'request.symb'}) { - return $env{$cache_str}=&symbclean($env{'request.symb'}); + if ($nocache) { + return &symbclean($env{'request.symb'}); + } else { + return $env{$cache_str}=&symbclean($env{'request.symb'}); + } } $thisfn=$env{'request.filename'}; } @@ -12447,7 +12471,11 @@ # is that filename actually a symb? Verify, clean, and return if ($thisfn=~/\_\_\_\d+\_\_\_(.*)$/) { if (&symbverify($thisfn,$1)) { - return $env{$cache_str}=&symbclean($thisfn); + if ($nocache) { + return &symbclean($thisfn); + } else { + return $env{$cache_str}=&symbclean($thisfn); + } } } $thisfn=declutter($thisfn); @@ -12462,10 +12490,18 @@ if ($targetfn =~ m|^adm/wrapper/(ext/.*)|) { $targetfn=$1; } - if (tie(%hash,'GDBM_File',$env{'request.course.fn'}.'_symb.db', - &GDBM_READER(),0640)) { - $syval=$hash{$targetfn}; - untie(%hash); + unless ($nocache) { + if (tie(%hash,'GDBM_File',$env{'request.course.fn'}.'_symb.db', + &GDBM_READER(),0640)) { + $syval=$hash{$targetfn}; + untie(%hash); + } + if ($syval) { + my @blockers = &has_comm_blocking('bre',$syval,$thisfn,$nocache); + if (@blockers) { + $syval=''; + } + } } # ---------------------------------------------------------- There was an entry if ($syval) { @@ -12498,13 +12534,19 @@ $syval=&encode_symb($bighash{'map_id_'.$mapid}, $resid,$thisfn); if (ref($possibles) eq 'HASH') { - $possibles->{$syval} = 1; + unless ($bighash{'randomout_'.$ids} || $env{'request.role.adv'}) { + $possibles->{$syval} = 1; + } } if ($checkforblock) { - my @blockers = &has_comm_blocking('bre',$syval,$bighash{'src_'.$ids}); - if (@blockers) { - $syval = ''; - return; + unless ($bighash{'randomout_'.$ids} || $env{'request.role.adv'}) { + my @blockers = &has_comm_blocking('bre',$syval,$bighash{'src_'.$ids}); + if (@blockers) { + $syval = ''; + untie(%bighash); + return '' if ($nocache); + return $env{$cache_str}=''; + } } } } elsif ((!$donotrecurse) || ($checkforblock) || (ref($possibles) eq 'HASH')) { @@ -12523,12 +12565,13 @@ if ($bighash{'map_type_'.$mapid} ne 'page') { my $poss_syval=&encode_symb($bighash{'map_id_'.$mapid}, $resid,$thisfn); - if (ref($possibles) eq 'HASH') { - $possibles->{$syval} = 1; - } + next if ($bighash{'randomout_'.$id} && !$env{'request.role.adv'}); + next unless ($bighash{'encrypted_'.$id} eq $env{'request.enc'}); if ($checkforblock) { my @blockers = &has_comm_blocking('bre',$poss_syval,$file); - unless (@blockers > 0) { + if (@blockers > 0) { + $syval = ''; + } else { $syval = $poss_syval; $realpossible++; } @@ -12536,6 +12579,11 @@ $syval = $poss_syval; $realpossible++; } + if ($syval) { + if (ref($possibles) eq 'HASH') { + $possibles->{$syval} = 1; + } + } } } } @@ -12548,10 +12596,15 @@ } } if ($syval) { - return $env{$cache_str}=$syval; + if ($nocache) { + return $syval; + } else { + return $env{$cache_str}=$syval; + } } } &appenv({'request.ambiguous' => $thisfn}); + return '' if ($nocache); return $env{$cache_str}=''; } From raeburn at source.lon-capa.org Mon Sep 28 11:11:55 2020 From: raeburn at source.lon-capa.org (raeburn) Date: Mon, 28 Sep 2020 15:11:55 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /dns_checksums 2.11.3.tab Message-ID: raeburn Mon Sep 28 15:11:55 2020 EDT Modified files: /loncom/dns_checksums 2.11.3.tab Log: - Update versions/checksums Index: loncom/dns_checksums/2.11.3.tab diff -u loncom/dns_checksums/2.11.3.tab:1.40 loncom/dns_checksums/2.11.3.tab:1.41 --- loncom/dns_checksums/2.11.3.tab:1.40 Sat Sep 12 21:55:23 2020 +++ loncom/dns_checksums/2.11.3.tab Mon Sep 28 15:11:55 2020 @@ -1,5 +1,5 @@ 2.11.3 -/etc/httpd/conf/loncapa_apache.conf,1.215.2.29,fba4c0c7a3f50370bd598fff860d0758f08c5173 +/etc/httpd/conf/loncapa_apache.conf,1.215.2.29,300250b8ef4a13c31293788bf57eac55dab4a362 /etc/httpd/conf/startup.pl,1.41.2.3,f20be7932eb991b5d0fe8fbbd33697db1ad1fef1 /home/httpd/cgi-bin/barcode.png,1.12,57bb6c59faa8f28283e9a33fb978d96b076a1ecb /home/httpd/cgi-bin/clusterstatus.pl,1.28,a81dbce03f04cecc9622058845d66ca73b2a4733 @@ -33,7 +33,7 @@ /home/httpd/lib/perl/Apache/Spreadsheet.pm,1.85,d66a54052c66e1f0710216f323c5ebfab40226fe /home/httpd/lib/perl/Apache/admannotations.pm,1.36,00416c340cabdf2db612b37ef7a63a7fac661bff /home/httpd/lib/perl/Apache/assesscalc.pm,1.60,b7d81c310159dff661579b6431ff2a0b9f0d7f5a -/home/httpd/lib/perl/Apache/blockedaccess.pm,1.4,2900e8a51e2f6db30a475f5495d69b88ca3f2113 +/home/httpd/lib/perl/Apache/blockedaccess.pm,1.5,344b2a5f14ae6c7be7b43e0e448a9a28217f764c /home/httpd/lib/perl/Apache/bridgetask.pm,1.264.8.1,b40d023b926ff31857e2e44bf4aac57b2fccbf8a /home/httpd/lib/perl/Apache/caparesponse.pm,1.260,7c2c21440ed612961b892cb1b14e2067a497f349 /home/httpd/lib/perl/Apache/checkauthen.pm,1.19,2d9febf16f996fffa2ff229d108cfa24da6dccd8 @@ -79,13 +79,13 @@ /home/httpd/lib/perl/Apache/localize/x_chef.pm,1.5,cf549a68355f46cd33aecbe8cbc086769255ab26 /home/httpd/lib/perl/Apache/localize/zh.pm,1.130,d5f4f4b093d96013e5b2183135da34215d1dbe10 /home/httpd/lib/perl/Apache/lonaboutme.pm,1.158,63cbc1c1ad11a65fc95b84db16e622e7891a82e4 -/home/httpd/lib/perl/Apache/lonacc.pm,1.159.2.10,cea622f3eb1d373150763c27deda325dc078fd41 +/home/httpd/lib/perl/Apache/lonacc.pm,1.159.2.11,c9c3dedbe3cbf56301601b5e1a20954f15cfc1d4 /home/httpd/lib/perl/Apache/lonaccesstimes.pm,1.2,087cb9fa9e6cca202accb0b77f6797907975a334 /home/httpd/lib/perl/Apache/lonambiguous.pm,1.26,5b6a1dc19fc35a87f7164ace497db858af3a8516 /home/httpd/lib/perl/Apache/lonannounce.pm,1.88,8312b5386a664740c40bcb8ea1947b8dd13ea82b /home/httpd/lib/perl/Apache/lonauth.pm,1.121.2.19,f97c5fd49db2f1304b339c2a212420294d50f6aa /home/httpd/lib/perl/Apache/lonblockingmenu.pm,1.14.2.3,21ac6cb80d0281ba5f182016f432d0d20efbc83f -/home/httpd/lib/perl/Apache/lonblockingstatus.pm,1.14.2.2,68ce7b513eb03c2a9a15350c16f8923e9ce6ffd4 +/home/httpd/lib/perl/Apache/lonblockingstatus.pm,1.14.2.3,7ecad3f23dacab86fb8133d053906a9ab158f571 /home/httpd/lib/perl/Apache/lonbulletin.pm,1.69,9e51602019a12bcb31be1df706b4a71efda7c826 /home/httpd/lib/perl/Apache/loncacc.pm,1.61,57d7b2670e1bacbee9ca1bd45093b394817033ad /home/httpd/lib/perl/Apache/loncapagrade.pm,1.7,e7af8cc5693608812a8d1260f40f388924586ad2 @@ -94,7 +94,7 @@ /home/httpd/lib/perl/Apache/lonchatfetch.pm,1.39,e16f3a73a6442f6c8f00a8c5e309a87172225e8d /home/httpd/lib/perl/Apache/loncleanup.pm,1.20,a2eda69dd84e763d666dad9da1f3db520546bcee /home/httpd/lib/perl/Apache/lonclonecourse.pm,1.13.2.1,3978e825a038629aa7dd55bcfc1d816ee07bf733 -/home/httpd/lib/perl/Apache/loncommon.pm,1.1075.2.146,7d6d981187861cfb39c1c7b6dcf41c2481bfdec0 +/home/httpd/lib/perl/Apache/loncommon.pm,1.1075.2.147,d46a7f902c52c194766a9fbd520e9d408dc1c594 /home/httpd/lib/perl/Apache/loncommunicate.pm,1.47,596a9fcc00dd7901ab0c6d9b303637542aecf25c /home/httpd/lib/perl/Apache/lonconfigsettings.pm,1.21.4.11,d7affa3e0d86a63f33775b5d9ba008ba7fce6f79 /home/httpd/lib/perl/Apache/loncorrectproblemplot.pm,1.28.2.1,fc3b683a9c9467b84de2d3ad178e5553787b590c @@ -146,7 +146,7 @@ /home/httpd/lib/perl/Apache/lonmysql.pm,1.41,2ea9e2f11dda38fb1d83c8d07675d431d274f81a /home/httpd/lib/perl/Apache/lonnavdisplay.pm,1.22.4.9,ae241b4a7c2d03802a659c40e9b81004dddb2c84 /home/httpd/lib/perl/Apache/lonnavmaps.pm,1.509.2.13,b2a76e70abf00da144b01bd9164e6c4c7f625537 -/home/httpd/lib/perl/Apache/lonnet.pm,1.1172.2.125,cefe030a5d951a6aa17f7a578fe8faa54c3780d8 +/home/httpd/lib/perl/Apache/lonnet.pm,1.1172.2.126,db98e5dceb2537a3a4454df8ffc5b42d3d656559 /home/httpd/lib/perl/Apache/lonnoshib.pm,1.1,333834f9aeae740d3049d9caf5046e56febfb34d /home/httpd/lib/perl/Apache/lonnotify.pm,1.43,91fea877d3dbff3744e36fa823ebdba5eb6547db /home/httpd/lib/perl/Apache/lonpage.pm,1.111.2.12,8d00e853623a2f3d5671b09739109dc820db6be0 @@ -243,7 +243,7 @@ /home/httpd/lib/perl/Apache/simpleauthen.pm,1.2,c7aaab641b31ec23392cc59000c06ae9017daf3a /home/httpd/lib/perl/Apache/slotrequest.pm,1.125.2.9,c3b29b9b0f79e6fd73bdf16b077db1c8057fc5b1 /home/httpd/lib/perl/Apache/spellcheck.pm,1.4,941818711e91b9c990273d3929fbcb8b21726c31 -/home/httpd/lib/perl/Apache/structuretags.pm,1.512.2.23,bbb81c1d5862ca791b91907ec37be5fbca23565d +/home/httpd/lib/perl/Apache/structuretags.pm,1.512.2.24,e1b7a1fb5dd2b685a3969af348c21e2550513b74 /home/httpd/lib/perl/Apache/studentcalc.pm,1.46,e2629dea38908f50a112e96b7ab271516b1a46f7 /home/httpd/lib/perl/Apache/style.pm,1.22,4b89903ace9c562726614abbcaff408fc12987d4 /home/httpd/lib/perl/Apache/switchserver.pm,1.35.2.2,214e4b61690a11fff2a13bc088d4eff6c53791f9 From raeburn at source.lon-capa.org Tue Sep 29 15:29:51 2020 From: raeburn at source.lon-capa.org (raeburn) Date: Tue, 29 Sep 2020 19:29:51 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonblockingstatus.pm Message-ID: raeburn Tue Sep 29 19:29:51 2020 EDT Modified files: /loncom/interface lonblockingstatus.pm Log: - Remove trailing white space - Remove blank line - Add missing semicolon Index: loncom/interface/lonblockingstatus.pm diff -u loncom/interface/lonblockingstatus.pm:1.17 loncom/interface/lonblockingstatus.pm:1.18 --- loncom/interface/lonblockingstatus.pm:1.17 Mon Sep 28 00:10:28 2020 +++ loncom/interface/lonblockingstatus.pm Tue Sep 29 19:29:51 2020 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # displays the blocking status table # -# $Id: lonblockingstatus.pm,v 1.17 2020/09/28 00:10:28 raeburn Exp $ +# $Id: lonblockingstatus.pm,v 1.18 2020/09/29 19:29:51 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -71,13 +71,12 @@ } else { $r->print(&blockpage($activity,$origurl,$origsymb)); } - + $r->print(&Apache::loncommon::end_page()); return OK; } - sub blockpage { my ($activity,$origurl,$origsymb) = @_; @@ -85,7 +84,7 @@ # we're trying to look at. This information is passed via query string. my ($uname, $udom); - if (($activity eq 'port') || + if (($activity eq 'port') || (($activity eq 'passwd') && ($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public'))) { &Apache::loncommon::get_unprocessed_cgi( $ENV{'QUERY_STRING'}, ['udom', 'uname'] ); @@ -96,7 +95,7 @@ return ''. &mt('Information about the owner of the portfolio files you were trying to view was missing or invalid.'). '
'. - &mt('Without valid owner information, the reason why access is blocked can not be determined'); + &mt('Without valid owner information, the reason why access is blocked can not be determined'); } else { return ''. &mt('Information about the username and/or domain for which you were trying to reset a password was missing or invalid.'). @@ -133,12 +132,12 @@ return '

'.&mt('Could not determine why access is blocked.').'

'; } } else { - ($startblock,$endblock,$triggerblock) = + ($startblock,$endblock,$triggerblock) = &Apache::loncommon::blockcheck(\%setters,$activity,$uname,$udom,$origurl,undef,$origsymb,'blockingstatus'); } # nothing to do if there's no active blocking - unless ($startblock && $endblock) { + unless ($startblock && $endblock) { if ($activity eq 'docs') { return '

'.&mt('Content no longer blocked from access').'

'; } @@ -153,7 +152,7 @@ com => 'This message', blogs => 'Blogs', groups => 'Groups in this course', - printout => 'Printout generation', + printout => 'Printout generation', docs => 'Course Content', passwd => 'Changing of passwords', grades => 'Course Gradebook', @@ -185,7 +184,7 @@ if ( ref($description) ne 'ARRAY' ) { #default: $description is one of the above descriptions if ($activity eq 'docs') { - $output=&mt( 'Access to the content page you are attempting to' + $output=&mt( 'Access to the content page you are attempting to' . ' view will be unavailable between [_1] and [_2] because' . ' access to selected '.$description.' is being blocked.' ,$showstart, $showend); @@ -199,7 +198,7 @@ $output = mt( $description . ' will be inaccessible between [_1] and [_2] because' . ' communication is being blocked.' - ,$showstart, $showend); + ,$showstart, $showend); } } else { # @$description is is the array returned from get_portfolio_category() @@ -208,12 +207,12 @@ $output = mt( $$description[0] . ' will be inaccessible between [_2] and [_3] because' . ' communication is being blocked.' - ,$$description[1], $showstart, $showend) + ,$$description[1], $showstart, $showend); } $output = "

$output

"; - # show a table containing details, except if user is trying to look + # show a table containing details, except if user is trying to look # at a different user's portfolio files if ( $activity ne 'port' # no portfolio || ( $uname eq $env{'user.name'} # or own portfolio @@ -254,7 +253,7 @@ } my $triggertype = $$setters{$course}{triggers}[$i]; if ($triggertype) { - $fullname .= &mt(' (triggered by you when starting timer)'); + $fullname .= &mt(' (triggered by you when starting timer)'); } my ($openblock,$closeblock) = @{$$setters{$course}{times}[$i]}; $openblock = &Apache::lonlocal::locallocaltime($openblock); From raeburn at source.lon-capa.org Tue Sep 29 15:55:00 2020 From: raeburn at source.lon-capa.org (raeburn) Date: Tue, 29 Sep 2020 19:55:00 -0000 Subject: [LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonblockingstatus.pm Message-ID: raeburn Tue Sep 29 19:55:00 2020 EDT Modified files: (Branch: version_2_11_X) /loncom/interface lonblockingstatus.pm Log: - For 2.11 Backport 1.18 Index: loncom/interface/lonblockingstatus.pm diff -u loncom/interface/lonblockingstatus.pm:1.14.2.3 loncom/interface/lonblockingstatus.pm:1.14.2.4 --- loncom/interface/lonblockingstatus.pm:1.14.2.3 Mon Sep 28 00:27:48 2020 +++ loncom/interface/lonblockingstatus.pm Tue Sep 29 19:55:00 2020 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # displays the blocking status table # -# $Id: lonblockingstatus.pm,v 1.14.2.3 2020/09/28 00:27:48 raeburn Exp $ +# $Id: lonblockingstatus.pm,v 1.14.2.4 2020/09/29 19:55:00 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -70,13 +70,12 @@ } else { $r->print(&blockpage($activity,$origurl,$origsymb)); } - + $r->print(&Apache::loncommon::end_page()); return OK; } - sub blockpage { my ($activity,$origurl,$origsymb) = @_; @@ -84,7 +83,7 @@ # we're trying to look at. This information is passed via query string. my ($uname, $udom); - if (($activity eq 'port') || + if (($activity eq 'port') || (($activity eq 'passwd') && ($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public'))) { &Apache::loncommon::get_unprocessed_cgi( $ENV{'QUERY_STRING'}, ['udom', 'uname'] ); @@ -95,7 +94,7 @@ return ''. &mt('Information about the owner of the portfolio files you were trying to view was missing or invalid.'). '
'. - &mt('Without valid owner information, the reason why access is blocked can not be determined'); + &mt('Without valid owner information, the reason why access is blocked can not be determined'); } else { return ''. &mt('Information about the username and/or domain for which you were trying to reset a password was missing or invalid.'). @@ -132,7 +131,7 @@ return '

'.&mt('Could not determine why access is blocked.').'

'; } } else { - ($startblock,$endblock,$triggerblock) = + ($startblock,$endblock,$triggerblock) = &Apache::loncommon::blockcheck(\%setters,$activity,$uname,$udom,$origurl,undef,$origsymb,'blockingstatus'); } @@ -152,7 +151,7 @@ com => 'This message', blogs => 'Blogs', groups => 'Groups in this course', - printout => 'Printout generation', + printout => 'Printout generation', docs => 'Course Content', passwd => 'Changing of passwords', ); @@ -161,7 +160,7 @@ if (&Apache::loncommon::course_type() eq 'Community') { $descs{'boards'} = 'Discussion posts in this community'; $descs{'groups'} = 'Groups in this community'; - $descs{'docs'} = 'Community Content'; + $descs{'docs'} = 'Community Content'; } } @@ -177,11 +176,11 @@ my $showend = Apache::lonlocal::locallocaltime($endblock); my $output; - + if ( ref($description) ne 'ARRAY' ) { #default: $description is one of the above descriptions if ($activity eq 'docs') { - $output=&mt( 'Access to the content page you are attempting to' + $output=&mt( 'Access to the content page you are attempting to' . ' view will be unavailable between [_1] and [_2] because' . ' access to selected '.$description.' is being blocked.' ,$showstart, $showend); @@ -194,7 +193,7 @@ $output = mt( $description . ' will be inaccessible between [_1] and [_2] because' . ' communication is being blocked.' - ,$showstart, $showend); + ,$showstart, $showend); } } else { # @$description is is the array returned from get_portfolio_category() @@ -203,12 +202,12 @@ $output = mt( $$description[0] . ' will be inaccessible between [_2] and [_3] because' . ' communication is being blocked.' - ,$$description[1], $showstart, $showend) + ,$$description[1], $showstart, $showend); } $output = "

$output

"; - # show a table containing details, except if user is trying to look + # show a table containing details, except if user is trying to look # at a different user's portfolio files if ( $activity ne 'port' # no portfolio || ( $uname eq $env{'user.name'} # or own portfolio @@ -249,7 +248,7 @@ } my $triggertype = $$setters{$course}{triggers}[$i]; if ($triggertype) { - $fullname .= &mt(' (triggered by you when starting timer)'); + $fullname .= &mt(' (triggered by you when starting timer)'); } my ($openblock,$closeblock) = @{$$setters{$course}{times}[$i]}; $openblock = &Apache::lonlocal::locallocaltime($openblock); From raeburn at source.lon-capa.org Wed Sep 30 15:25:16 2020 From: raeburn at source.lon-capa.org (raeburn) Date: Wed, 30 Sep 2020 19:25:16 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /auth lonacc.pm Message-ID: raeburn Wed Sep 30 19:25:16 2020 EDT Modified files: /loncom/auth lonacc.pm Log: - Modify changes in rev. 1.179. Code to deteect whether requested URL will have a symb moved from &needs_symb() routine into main &handler(), and called once to set value for $check_symb for later use. -------------- next part -------------- Index: loncom/auth/lonacc.pm diff -u loncom/auth/lonacc.pm:1.179 loncom/auth/lonacc.pm:1.180 --- loncom/auth/lonacc.pm:1.179 Mon Sep 28 00:10:27 2020 +++ loncom/auth/lonacc.pm Wed Sep 30 19:25:16 2020 @@ -1,7 +1,7 @@ # The LearningOnline Network # Cookie Based Access Handler # -# $Id: lonacc.pm,v 1.179 2020/09/28 00:10:27 raeburn Exp $ +# $Id: lonacc.pm,v 1.180 2020/09/30 19:25:16 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -452,22 +452,6 @@ return undef; } -sub needs_symb_check { - my ($requrl) = @_; - $requrl=~/\.(\w+)$/; - if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') || - ($requrl=~/^\/adm\/.*\/(aboutme|smppg|bulletinboard)(\?|$ )/x) || - ($requrl=~/^\/adm\/wrapper\//) || - ($requrl=~m|^/adm/coursedocs/showdoc/|) || - ($requrl=~m|\.problem/smpedit$|) || - ($requrl=~/^\/public\/.*\/syllabus$/) || - ($requrl=~/^\/adm\/(viewclasslist|navmaps)$/) || - ($requrl=~/^\/adm\/.*\/aboutme\/portfolio(\?|$)/)) { - return 1; - } - return; -} - sub handler { my $r = shift; my $requrl=$r->uri; @@ -563,6 +547,7 @@ if ($value =~ /^supplemental/) { $suppext = 1; } + last; } } } @@ -635,17 +620,35 @@ } # ---------------------------------------------------------------- Check access my $now = time; + my $check_symb; if ($requrl !~ m{^/(?:adm|public|(?:prt|zip)spool)/} || $requrl =~ /^\/adm\/.*\/(smppg|bulletinboard)(\?|$ )/x) { my ($access,$poss_symb); - if (($env{'request.course.id'}) && (!$suppext) && (&needs_symb_check($requrl))) { - unless ($env{'form.symb'}) { - if ($r->args) { - &Apache::loncommon::get_unprocessed_cgi($r->args,['symb']); - } + if (($env{'request.course.id'}) && (!$suppext)) { + $requrl=~/\.(\w+)$/; + if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') || + ($requrl=~/^\/adm\/.*\/(aboutme|smppg|bulletinboard)(\?|$ )/x) || + ($requrl=~/^\/adm\/wrapper\//) || + ($requrl=~m|^/adm/coursedocs/showdoc/|) || + ($requrl=~m|\.problem/smpedit$|) || + ($requrl=~/^\/public\/.*\/syllabus$/) || + ($requrl=~/^\/adm\/(viewclasslist|navmaps)$/) || + ($requrl=~/^\/adm\/.*\/aboutme\/portfolio(\?|$)/)) { + $check_symb = 1; } + } + if ($check_symb) { if ($env{'form.symb'}) { $poss_symb=&Apache::lonnet::symbclean($env{'form.symb'}); + } elsif (($env{'request.course.id'}) && ($r->args ne '')) { + my $query = $r->args; + foreach my $pair (split(/&/,$query)) { + my ($name, $value) = split(/=/,$pair); + if ($name eq 'symb') { + $poss_symb = &Apache::lonnet::symbclean($value); + last; + } + } } if ($poss_symb) { my ($possmap,$resid,$url)=&Apache::lonnet::decode_symb($poss_symb); @@ -746,7 +749,7 @@ $env{'user.domain'} eq 'public' && $requrl !~ m{^/+(res|public|uploaded)/} && $requrl !~ m{^/adm/[^/]+/[^/]+/aboutme/portfolio$ }x && - $requrl !~ m{^/adm/blockingstatus/.*$} && + $requrl !~ m{^/adm/blockingstatus/.*$} && $requrl !~ m{^/+adm/(help|logout|restrictedaccess|randomlabel\.png)}) { $env{'request.querystring'}=$r->args; $env{'request.firsturl'}=$requrl; @@ -756,7 +759,7 @@ if ($env{'request.course.id'}) { &Apache::lonnet::countacc($requrl); my $query=$r->args; - if (&needs_symb_check($requrl)) { + if ($check_symb) { # ------------------------------------- This is serious stuff, get symb and log my $symb; if ($query) { @@ -799,54 +802,52 @@ if ($requrl=~m{^(/adm/.*/aboutme)/portfolio$}) { $requrl = $1; } - unless ($suppext) { - $symb=&Apache::lonnet::symbread($requrl); - if (&Apache::lonnet::is_on_map($requrl) && $symb) { - my ($encstate,$invalidsymb); - unless (&Apache::lonnet::symbverify($symb,$requrl,\$encstate)) { - $invalidsymb = 1; - # - # If $env{'request.enc'} is true, but no encryption for $symb retrieved - # by original lonnet::symbread() call, call again to check for an instance - # of $requrl in the course which has encryption, and set that as the symb. - # If there is no such symb, or symbverify() fails for the new symb proceed - # to report invalid symb. - # - if ($env{'request.enc'} && !$encstate) { - my %possibles; - my $nocache = 1; - $symb = &Apache::lonnet::symbread($requrl,'','','',\%possibles,$nocache); - if ($symb) { - if (&Apache::lonnet::symbverify($symb,$requrl)) { - $invalidsymb = ''; - } - } elsif (keys(%possibles) > 1) { - $r->internal_redirect('/adm/ambiguous'); - return OK; + $symb=&Apache::lonnet::symbread($requrl); + if (&Apache::lonnet::is_on_map($requrl) && $symb) { + my ($encstate,$invalidsymb); + unless (&Apache::lonnet::symbverify($symb,$requrl,\$encstate)) { + $invalidsymb = 1; + # + # If $env{'request.enc'} is true, but no encryption for $symb retrieved + # by original lonnet::symbread() call, call again to check for an instance + # of $requrl in the course which has encryption, and set that as the symb. + # If there is no such symb, or symbverify() fails for the new symb proceed + # to report invalid symb. + # + if ($env{'request.enc'} && !$encstate) { + my %possibles; + my $nocache = 1; + $symb = &Apache::lonnet::symbread($requrl,'','','',\%possibles,$nocache); + if ($symb) { + if (&Apache::lonnet::symbverify($symb,$requrl)) { + $invalidsymb = ''; } + } elsif (keys(%possibles) > 1) { + $r->internal_redirect('/adm/ambiguous'); + return OK; } - if ($invalidsymb) { - $r->log_reason('Invalid symb for '.$requrl.': '.$symb); - $env{'user.error.msg'}= - "$requrl:bre:1:1:Invalid Access"; - return HTTP_NOT_ACCEPTABLE; - } + } + if ($invalidsymb) { + $r->log_reason('Invalid symb for '.$requrl.': '.$symb); + $env{'user.error.msg'}= + "$requrl:bre:1:1:Invalid Access"; + return HTTP_NOT_ACCEPTABLE; } } - if ($symb) { - my ($map,$mid,$murl)= - &Apache::lonnet::decode_symb($symb); - if ($requrl eq '/adm/navmaps') { - &Apache::lonnet::symblist($map,$murl =>[$murl,$mid]); - } else { - if (($map =~ /\.page$/) && ($requrl !~ /\.page$/)) { - my $mapsymb = &Apache::lonnet::symbread($map); - ($map,$mid,$murl)=&Apache::lonnet::decode_symb($mapsymb); - } - &Apache::lonnet::symblist($map,$murl =>[$murl,$mid], - 'last_known' =>[$murl,$mid]); + } + if ($symb) { + my ($map,$mid,$murl)= + &Apache::lonnet::decode_symb($symb); + if ($requrl eq '/adm/navmaps') { + &Apache::lonnet::symblist($map,$murl =>[$murl,$mid]); + } else { + if (($map =~ /\.page$/) && ($requrl !~ /\.page$/)) { + my $mapsymb = &Apache::lonnet::symbread($map); + ($map,$mid,$murl)=&Apache::lonnet::decode_symb($mapsymb); } - } + &Apache::lonnet::symblist($map,$murl =>[$murl,$mid], + 'last_known' =>[$murl,$mid]); + } } } $env{'request.symb'}=$symb; From raeburn at source.lon-capa.org Wed Sep 30 15:33:59 2020 From: raeburn at source.lon-capa.org (raeburn) Date: Wed, 30 Sep 2020 19:33:59 -0000 Subject: [LON-CAPA-cvs] cvs: loncom(version_2_11_X) /auth lonacc.pm Message-ID: raeburn Wed Sep 30 19:33:59 2020 EDT Modified files: (Branch: version_2_11_X) /loncom/auth lonacc.pm Log: - For 2.11 Backport 1.180 -------------- next part -------------- Index: loncom/auth/lonacc.pm diff -u loncom/auth/lonacc.pm:1.159.2.11 loncom/auth/lonacc.pm:1.159.2.12 --- loncom/auth/lonacc.pm:1.159.2.11 Mon Sep 28 01:31:42 2020 +++ loncom/auth/lonacc.pm Wed Sep 30 19:33:59 2020 @@ -1,7 +1,7 @@ # The LearningOnline Network # Cookie Based Access Handler # -# $Id: lonacc.pm,v 1.159.2.11 2020/09/28 01:31:42 raeburn Exp $ +# $Id: lonacc.pm,v 1.159.2.12 2020/09/30 19:33:59 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -435,22 +435,6 @@ return undef; } -sub needs_symb_check { - my ($requrl) = @_; - $requrl=~/\.(\w+)$/; - if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') || - ($requrl=~/^\/adm\/.*\/(aboutme|smppg|bulletinboard)(\?|$ )/x) || - ($requrl=~/^\/adm\/wrapper\//) || - ($requrl=~m|^/adm/coursedocs/showdoc/|) || - ($requrl=~m|\.problem/smpedit$|) || - ($requrl=~/^\/public\/.*\/syllabus$/) || - ($requrl=~/^\/adm\/(viewclasslist|navmaps)$/) || - ($requrl=~/^\/adm\/.*\/aboutme\/portfolio(\?|$)/)) { - return 1; - } - return; -} - sub handler { my $r = shift; my $requrl=$r->uri; @@ -545,6 +529,7 @@ if ($value =~ /^supplemental/) { $suppext = 1; } + last; } } } @@ -608,17 +593,35 @@ # ---------------------------------------------------------------- Check access my $now = time; + my $check_symb; if ($requrl !~ m{^/(?:adm|public|(?:prt|zip)spool)/} || $requrl =~ /^\/adm\/.*\/(smppg|bulletinboard)(\?|$ )/x) { my ($access,$poss_symb); - if (($env{'request.course.id'}) && (!$suppext) && (&needs_symb_check($requrl))) { - unless ($env{'form.symb'}) { - if ($r->args) { - &Apache::loncommon::get_unprocessed_cgi($r->args,['symb']); - } + if (($env{'request.course.id'}) && (!$suppext)) { + $requrl=~/\.(\w+)$/; + if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') || + ($requrl=~/^\/adm\/.*\/(aboutme|smppg|bulletinboard)(\?|$ )/x) || + ($requrl=~/^\/adm\/wrapper\//) || + ($requrl=~m|^/adm/coursedocs/showdoc/|) || + ($requrl=~m|\.problem/smpedit$|) || + ($requrl=~/^\/public\/.*\/syllabus$/) || + ($requrl=~/^\/adm\/(viewclasslist|navmaps)$/) || + ($requrl=~/^\/adm\/.*\/aboutme\/portfolio(\?|$)/)) { + $check_symb = 1; } + } + if ($check_symb) { if ($env{'form.symb'}) { $poss_symb=&Apache::lonnet::symbclean($env{'form.symb'}); + } elsif (($env{'request.course.id'}) && ($r->args ne '')) { + my $query = $r->args; + foreach my $pair (split(/&/,$query)) { + my ($name, $value) = split(/=/,$pair); + if ($name eq 'symb') { + $poss_symb = &Apache::lonnet::symbclean($value); + last; + } + } } if ($poss_symb) { my ($possmap,$resid,$url)=&Apache::lonnet::decode_symb($poss_symb); @@ -715,7 +718,7 @@ $env{'user.domain'} eq 'public' && $requrl !~ m{^/+(res|public|uploaded)/} && $requrl !~ m{^/adm/[^/]+/[^/]+/aboutme/portfolio$ }x && - $requrl !~ m{^/adm/blockingstatus/.*$} && + $requrl !~ m{^/adm/blockingstatus/.*$} && $requrl !~ m{^/+adm/(help|logout|restrictedaccess|randomlabel\.png)}) { $env{'request.querystring'}=$r->args; $env{'request.firsturl'}=$requrl; @@ -725,7 +728,7 @@ if ($env{'request.course.id'}) { &Apache::lonnet::countacc($requrl); my $query=$r->args; - if (&needs_symb_check($requrl)) { + if ($check_symb) { # ------------------------------------- This is serious stuff, get symb and log my $symb; if ($query) { @@ -768,54 +771,52 @@ if ($requrl=~m{^(/adm/.*/aboutme)/portfolio$}) { $requrl = $1; } - unless ($suppext) { - $symb=&Apache::lonnet::symbread($requrl); - if (&Apache::lonnet::is_on_map($requrl) && $symb) { - my ($encstate,$invalidsymb); - unless (&Apache::lonnet::symbverify($symb,$requrl,\$encstate)) { - $invalidsymb = 1; - # - # If $env{'request.enc'} is true, but no encryption for $symb retrieved - # by original lonnet::symbread() call, call again to check for an instance - # of $requrl in the course which has encryption, and set that as the symb. - # If there is no such symb, or symbverify() fails for the new symb proceed - # to report invalid symb. - # - if ($env{'request.enc'} && !$encstate) { - my %possibles; - my $nocache = 1; - $symb = &Apache::lonnet::symbread($requrl,'','','',\%possibles,$nocache); - if ($symb) { - if (&Apache::lonnet::symbverify($symb,$requrl)) { - $invalidsymb = ''; - } - } elsif (keys(%possibles) > 1) { - $r->internal_redirect('/adm/ambiguous'); - return OK; + $symb=&Apache::lonnet::symbread($requrl); + if (&Apache::lonnet::is_on_map($requrl) && $symb) { + my ($encstate,$invalidsymb); + unless (&Apache::lonnet::symbverify($symb,$requrl,\$encstate)) { + $invalidsymb = 1; + # + # If $env{'request.enc'} is true, but no encryption for $symb retrieved + # by original lonnet::symbread() call, call again to check for an instance + # of $requrl in the course which has encryption, and set that as the symb. + # If there is no such symb, or symbverify() fails for the new symb proceed + # to report invalid symb. + # + if ($env{'request.enc'} && !$encstate) { + my %possibles; + my $nocache = 1; + $symb = &Apache::lonnet::symbread($requrl,'','','',\%possibles,$nocache); + if ($symb) { + if (&Apache::lonnet::symbverify($symb,$requrl)) { + $invalidsymb = ''; } + } elsif (keys(%possibles) > 1) { + $r->internal_redirect('/adm/ambiguous'); + return OK; } - if ($invalidsymb) { - $r->log_reason('Invalid symb for '.$requrl.': '.$symb); - $env{'user.error.msg'}= - "$requrl:bre:1:1:Invalid Access"; - return HTTP_NOT_ACCEPTABLE; - } + } + if ($invalidsymb) { + $r->log_reason('Invalid symb for '.$requrl.': '.$symb); + $env{'user.error.msg'}= + "$requrl:bre:1:1:Invalid Access"; + return HTTP_NOT_ACCEPTABLE; } } - if ($symb) { - my ($map,$mid,$murl)= - &Apache::lonnet::decode_symb($symb); - if ($requrl eq '/adm/navmaps') { - &Apache::lonnet::symblist($map,$murl =>[$murl,$mid]); - } else { - if (($map =~ /\.page$/) && ($requrl !~ /\.page$/)) { - my $mapsymb = &Apache::lonnet::symbread($map); - ($map,$mid,$murl)=&Apache::lonnet::decode_symb($mapsymb); - } - &Apache::lonnet::symblist($map,$murl =>[$murl,$mid], - 'last_known' =>[$murl,$mid]); + } + if ($symb) { + my ($map,$mid,$murl)= + &Apache::lonnet::decode_symb($symb); + if ($requrl eq '/adm/navmaps') { + &Apache::lonnet::symblist($map,$murl =>[$murl,$mid]); + } else { + if (($map =~ /\.page$/) && ($requrl !~ /\.page$/)) { + my $mapsymb = &Apache::lonnet::symbread($map); + ($map,$mid,$murl)=&Apache::lonnet::decode_symb($mapsymb); } - } + &Apache::lonnet::symblist($map,$murl =>[$murl,$mid], + 'last_known' =>[$murl,$mid]); + } } } $env{'request.symb'}=$symb; From raeburn at source.lon-capa.org Thu Oct 1 06:16:34 2020 From: raeburn at source.lon-capa.org (raeburn) Date: Thu, 01 Oct 2020 10:16:34 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /auth blockedaccess.pm lonacc.pm /interface loncommon.pm /lonnet/perl lonnet.pm Message-ID: raeburn Thu Oct 1 10:16:34 2020 EDT Modified files: /loncom/auth blockedaccess.pm lonacc.pm /loncom/interface loncommon.pm /loncom/lonnet/perl lonnet.pm Log: - Bug 6518 Content blocking during quiz/exam. - For resources not in a course directly, but instead referenced by resources which are, symb to check to determine whether access should be blocked and why is symb of resource containing the dependency. - No $env{'request.enc'} in effect for dependent files. -------------- next part -------------- Index: loncom/auth/blockedaccess.pm diff -u loncom/auth/blockedaccess.pm:1.5 loncom/auth/blockedaccess.pm:1.6 --- loncom/auth/blockedaccess.pm:1.5 Mon Sep 28 00:10:27 2020 +++ loncom/auth/blockedaccess.pm Thu Oct 1 10:16:33 2020 @@ -1,7 +1,7 @@ # The LearningOnline Network # Information about blocking status for Portfolio files # -# $Id: blockedaccess.pm,v 1.5 2020/09/28 00:10:27 raeburn Exp $ +# $Id: blockedaccess.pm,v 1.6 2020/10/01 10:16:33 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -42,6 +42,7 @@ return OK if $r->header_only; &Apache::lonlocal::get_language_handle($r); + my $ver_origurl = $r->uri; my $origurl = &Apache::lonnet::deversion($r->uri); my ($blocked,$blocktext); @@ -55,8 +56,16 @@ my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; my $symb = $env{'request.symb'}; + my $url = $origurl; + # If no symb, and url is on not map, check for referrer + unless (($symb) || &Apache::lonnet::is_on_map($url) || ($origurl eq '/adm/blockedaccess')) { + my $refuri = $env{'httpref.'.$origurl} || $env{'httpref.'.$ver_origurl}; + if ($refuri) { + $url = $refuri; + } + } ($blocked,$blocktext) = - &Apache::loncommon::blocking_status('docs',$cnum,$cdom,$origurl,1,$symb,'blockedaccess'); + &Apache::loncommon::blocking_status('docs',$cnum,$cdom,$url,1,$symb,'blockedaccess'); } } if ($blocked) { Index: loncom/auth/lonacc.pm diff -u loncom/auth/lonacc.pm:1.180 loncom/auth/lonacc.pm:1.181 --- loncom/auth/lonacc.pm:1.180 Wed Sep 30 19:25:16 2020 +++ loncom/auth/lonacc.pm Thu Oct 1 10:16:33 2020 @@ -1,7 +1,7 @@ # The LearningOnline Network # Cookie Based Access Handler # -# $Id: lonacc.pm,v 1.180 2020/09/30 19:25:16 raeburn Exp $ +# $Id: lonacc.pm,v 1.181 2020/10/01 10:16:33 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -644,6 +644,9 @@ my $query = $r->args; foreach my $pair (split(/&/,$query)) { my ($name, $value) = split(/=/,$pair); + $name = &unescape($name); + $value =~ tr/+/ /; + $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; if ($name eq 'symb') { $poss_symb = &Apache::lonnet::symbclean($value); last; Index: loncom/interface/loncommon.pm diff -u loncom/interface/loncommon.pm:1.1347 loncom/interface/loncommon.pm:1.1348 --- loncom/interface/loncommon.pm:1.1347 Mon Sep 28 00:10:28 2020 +++ loncom/interface/loncommon.pm Thu Oct 1 10:16:33 2020 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1347 2020/09/28 00:10:28 raeburn Exp $ +# $Id: loncommon.pm,v 1.1348 2020/10/01 10:16:33 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -5316,12 +5316,13 @@ my $now = time; my %commblocks = &Apache::lonnet::get_comm_blocks($cdom,$cnum); if ($activity eq 'docs') { - my ($blocked,$nosymbcache); + my ($blocked,$nosymbcache,$noenccheck); if (($caller eq 'blockedaccess') || ($caller eq 'blockingstatus')) { $blocked = 1; $nosymbcache = 1; + $noenccheck = 1; } - @blockers = &Apache::lonnet::has_comm_blocking('bre',$symb,$url,$nosymbcache,$blocked,\%commblocks); + @blockers = &Apache::lonnet::has_comm_blocking('bre',$symb,$url,$nosymbcache,$noenccheck,$blocked,\%commblocks); foreach my $block (@blockers) { if ($block =~ /^firstaccess____(.+)$/) { my $item = $1; Index: loncom/lonnet/perl/lonnet.pm diff -u loncom/lonnet/perl/lonnet.pm:1.1425 loncom/lonnet/perl/lonnet.pm:1.1426 --- loncom/lonnet/perl/lonnet.pm:1.1425 Mon Sep 28 13:08:57 2020 +++ loncom/lonnet/perl/lonnet.pm Thu Oct 1 10:16:34 2020 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1425 2020/09/28 13:08:57 raeburn Exp $ +# $Id: lonnet.pm,v 1.1426 2020/10/01 10:16:34 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -8290,7 +8290,7 @@ } elsif ($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 { @@ -8408,7 +8408,7 @@ } elsif ($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 { @@ -8829,7 +8829,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'); @@ -8839,7 +8839,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); @@ -13310,7 +13310,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') { @@ -13362,7 +13362,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=''; } @@ -13405,7 +13405,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); @@ -13431,9 +13431,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 { From raeburn at source.lon-capa.org Thu Oct 1 06:24:06 2020 From: raeburn at source.lon-capa.org (raeburn) Date: Thu, 01 Oct 2020 10:24:06 -0000 Subject: [LON-CAPA-cvs] cvs: loncom(version_2_11_X) /lonnet/perl lonnet.pm Message-ID: 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 { From raeburn at source.lon-capa.org Thu Oct 1 06:27:14 2020 From: raeburn at source.lon-capa.org (raeburn) Date: Thu, 01 Oct 2020 10:27:14 -0000 Subject: [LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface loncommon.pm Message-ID: raeburn Thu Oct 1 10:27:14 2020 EDT Modified files: (Branch: version_2_11_X) /loncom/interface loncommon.pm Log: - For 2.11 Backport 1.1348 Index: loncom/interface/loncommon.pm diff -u loncom/interface/loncommon.pm:1.1075.2.147 loncom/interface/loncommon.pm:1.1075.2.148 --- loncom/interface/loncommon.pm:1.1075.2.147 Mon Sep 28 00:38:30 2020 +++ loncom/interface/loncommon.pm Thu Oct 1 10:27:14 2020 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1075.2.147 2020/09/28 00:38:30 raeburn Exp $ +# $Id: loncommon.pm,v 1.1075.2.148 2020/10/01 10:27:14 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4844,12 +4844,13 @@ my $now = time; my %commblocks = &Apache::lonnet::get_comm_blocks($cdom,$cnum); if ($activity eq 'docs') { - my ($blocked,$nosymbcache); + my ($blocked,$nosymbcache,$noenccheck); if (($caller eq 'blockedaccess') || ($caller eq 'blockingstatus')) { $blocked = 1; $nosymbcache = 1; + $noenccheck = 1; } - @blockers = &Apache::lonnet::has_comm_blocking('bre',$symb,$url,$nosymbcache,$blocked,\%commblocks); + @blockers = &Apache::lonnet::has_comm_blocking('bre',$symb,$url,$nosymbcache,$noenccheck,$blocked,\%commblocks); foreach my $block (@blockers) { if ($block =~ /^firstaccess____(.+)$/) { my $item = $1; From raeburn at source.lon-capa.org Thu Oct 1 06:42:56 2020 From: raeburn at source.lon-capa.org (raeburn) Date: Thu, 01 Oct 2020 10:42:56 -0000 Subject: [LON-CAPA-cvs] cvs: loncom(version_2_11_X) /auth lonacc.pm Message-ID: raeburn Thu Oct 1 10:42:56 2020 EDT Modified files: (Branch: version_2_11_X) /loncom/auth lonacc.pm Log: - For 2.11 Backport 1.181 Index: loncom/auth/lonacc.pm diff -u loncom/auth/lonacc.pm:1.159.2.12 loncom/auth/lonacc.pm:1.159.2.13 --- loncom/auth/lonacc.pm:1.159.2.12 Wed Sep 30 19:33:59 2020 +++ loncom/auth/lonacc.pm Thu Oct 1 10:42:56 2020 @@ -1,7 +1,7 @@ # The LearningOnline Network # Cookie Based Access Handler # -# $Id: lonacc.pm,v 1.159.2.12 2020/09/30 19:33:59 raeburn Exp $ +# $Id: lonacc.pm,v 1.159.2.13 2020/10/01 10:42:56 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -617,6 +617,9 @@ my $query = $r->args; foreach my $pair (split(/&/,$query)) { my ($name, $value) = split(/=/,$pair); + $name = &unescape($name); + $value =~ tr/+/ /; + $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; if ($name eq 'symb') { $poss_symb = &Apache::lonnet::symbclean($value); last; From raeburn at source.lon-capa.org Thu Oct 1 07:01:20 2020 From: raeburn at source.lon-capa.org (raeburn) Date: Thu, 01 Oct 2020 11:01:20 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /dns_checksums 2.11.3.tab Message-ID: raeburn Thu Oct 1 11:01:20 2020 EDT Modified files: /loncom/dns_checksums 2.11.3.tab Log: - Update versions/checksums Index: loncom/dns_checksums/2.11.3.tab diff -u loncom/dns_checksums/2.11.3.tab:1.41 loncom/dns_checksums/2.11.3.tab:1.42 --- loncom/dns_checksums/2.11.3.tab:1.41 Mon Sep 28 15:11:55 2020 +++ loncom/dns_checksums/2.11.3.tab Thu Oct 1 11:01:20 2020 @@ -1,5 +1,5 @@ 2.11.3 -/etc/httpd/conf/loncapa_apache.conf,1.215.2.29,300250b8ef4a13c31293788bf57eac55dab4a362 +/etc/httpd/conf/loncapa_apache.conf,1.215.2.29,1e7040dd0e0e27ff5b397e7e7ba38048b5212bd1 /etc/httpd/conf/startup.pl,1.41.2.3,f20be7932eb991b5d0fe8fbbd33697db1ad1fef1 /home/httpd/cgi-bin/barcode.png,1.12,57bb6c59faa8f28283e9a33fb978d96b076a1ecb /home/httpd/cgi-bin/clusterstatus.pl,1.28,a81dbce03f04cecc9622058845d66ca73b2a4733 @@ -33,7 +33,7 @@ /home/httpd/lib/perl/Apache/Spreadsheet.pm,1.85,d66a54052c66e1f0710216f323c5ebfab40226fe /home/httpd/lib/perl/Apache/admannotations.pm,1.36,00416c340cabdf2db612b37ef7a63a7fac661bff /home/httpd/lib/perl/Apache/assesscalc.pm,1.60,b7d81c310159dff661579b6431ff2a0b9f0d7f5a -/home/httpd/lib/perl/Apache/blockedaccess.pm,1.5,344b2a5f14ae6c7be7b43e0e448a9a28217f764c +/home/httpd/lib/perl/Apache/blockedaccess.pm,1.6,cdf5a39c20bd2ad946a7f6be8a910e26588d3315 /home/httpd/lib/perl/Apache/bridgetask.pm,1.264.8.1,b40d023b926ff31857e2e44bf4aac57b2fccbf8a /home/httpd/lib/perl/Apache/caparesponse.pm,1.260,7c2c21440ed612961b892cb1b14e2067a497f349 /home/httpd/lib/perl/Apache/checkauthen.pm,1.19,2d9febf16f996fffa2ff229d108cfa24da6dccd8 @@ -79,13 +79,13 @@ /home/httpd/lib/perl/Apache/localize/x_chef.pm,1.5,cf549a68355f46cd33aecbe8cbc086769255ab26 /home/httpd/lib/perl/Apache/localize/zh.pm,1.130,d5f4f4b093d96013e5b2183135da34215d1dbe10 /home/httpd/lib/perl/Apache/lonaboutme.pm,1.158,63cbc1c1ad11a65fc95b84db16e622e7891a82e4 -/home/httpd/lib/perl/Apache/lonacc.pm,1.159.2.11,c9c3dedbe3cbf56301601b5e1a20954f15cfc1d4 +/home/httpd/lib/perl/Apache/lonacc.pm,1.159.2.13,78e2dd6283b865af8a5a41d6466fb64f42d2748d /home/httpd/lib/perl/Apache/lonaccesstimes.pm,1.2,087cb9fa9e6cca202accb0b77f6797907975a334 /home/httpd/lib/perl/Apache/lonambiguous.pm,1.26,5b6a1dc19fc35a87f7164ace497db858af3a8516 /home/httpd/lib/perl/Apache/lonannounce.pm,1.88,8312b5386a664740c40bcb8ea1947b8dd13ea82b /home/httpd/lib/perl/Apache/lonauth.pm,1.121.2.19,f97c5fd49db2f1304b339c2a212420294d50f6aa /home/httpd/lib/perl/Apache/lonblockingmenu.pm,1.14.2.3,21ac6cb80d0281ba5f182016f432d0d20efbc83f -/home/httpd/lib/perl/Apache/lonblockingstatus.pm,1.14.2.3,7ecad3f23dacab86fb8133d053906a9ab158f571 +/home/httpd/lib/perl/Apache/lonblockingstatus.pm,1.14.2.4,4c9f58ac3378bb9190f2833e1b20069b0c039d46 /home/httpd/lib/perl/Apache/lonbulletin.pm,1.69,9e51602019a12bcb31be1df706b4a71efda7c826 /home/httpd/lib/perl/Apache/loncacc.pm,1.61,57d7b2670e1bacbee9ca1bd45093b394817033ad /home/httpd/lib/perl/Apache/loncapagrade.pm,1.7,e7af8cc5693608812a8d1260f40f388924586ad2 @@ -94,7 +94,7 @@ /home/httpd/lib/perl/Apache/lonchatfetch.pm,1.39,e16f3a73a6442f6c8f00a8c5e309a87172225e8d /home/httpd/lib/perl/Apache/loncleanup.pm,1.20,a2eda69dd84e763d666dad9da1f3db520546bcee /home/httpd/lib/perl/Apache/lonclonecourse.pm,1.13.2.1,3978e825a038629aa7dd55bcfc1d816ee07bf733 -/home/httpd/lib/perl/Apache/loncommon.pm,1.1075.2.147,d46a7f902c52c194766a9fbd520e9d408dc1c594 +/home/httpd/lib/perl/Apache/loncommon.pm,1.1075.2.148,2beeb7565c2ba1a7c66bbc48a3fd91f5a1d7d7d6 /home/httpd/lib/perl/Apache/loncommunicate.pm,1.47,596a9fcc00dd7901ab0c6d9b303637542aecf25c /home/httpd/lib/perl/Apache/lonconfigsettings.pm,1.21.4.11,d7affa3e0d86a63f33775b5d9ba008ba7fce6f79 /home/httpd/lib/perl/Apache/loncorrectproblemplot.pm,1.28.2.1,fc3b683a9c9467b84de2d3ad178e5553787b590c @@ -146,7 +146,7 @@ /home/httpd/lib/perl/Apache/lonmysql.pm,1.41,2ea9e2f11dda38fb1d83c8d07675d431d274f81a /home/httpd/lib/perl/Apache/lonnavdisplay.pm,1.22.4.9,ae241b4a7c2d03802a659c40e9b81004dddb2c84 /home/httpd/lib/perl/Apache/lonnavmaps.pm,1.509.2.13,b2a76e70abf00da144b01bd9164e6c4c7f625537 -/home/httpd/lib/perl/Apache/lonnet.pm,1.1172.2.126,db98e5dceb2537a3a4454df8ffc5b42d3d656559 +/home/httpd/lib/perl/Apache/lonnet.pm,1.1172.2.127,599f8d21ae5814f3290015a58830426b6aa1b5b7 /home/httpd/lib/perl/Apache/lonnoshib.pm,1.1,333834f9aeae740d3049d9caf5046e56febfb34d /home/httpd/lib/perl/Apache/lonnotify.pm,1.43,91fea877d3dbff3744e36fa823ebdba5eb6547db /home/httpd/lib/perl/Apache/lonpage.pm,1.111.2.12,8d00e853623a2f3d5671b09739109dc820db6be0