--- loncom/auth/publiccheck.pm 2020/12/18 15:23:03 1.27 +++ loncom/auth/publiccheck.pm 2023/12/28 15:57:28 1.28 @@ -1,7 +1,7 @@ # The LearningOnline Network # Cookie Based Access Handler # -# $Id: publiccheck.pm,v 1.27 2020/12/18 15:23:03 raeburn Exp $ +# $Id: publiccheck.pm,v 1.28 2023/12/28 15:57:28 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -105,11 +105,16 @@ sub process_portfolio { my ($r,$udom,$unum,$file_name,$group) = @_; my $current_perms = &Apache::lonnet::get_portfile_permissions($udom,$unum); my %access_controls = &Apache::lonnet::get_access_controls($current_perms,$group,$file_name); + return unless (ref($access_controls{$file_name}) eq 'HASH'); my $access = ''; my $now = time; my $clientip = &Apache::lonnet::get_requestor_ip($r); + my $portaccess = &Apache::lonnet::usertools_access($unum,$udom,'portaccess',undef,'tools'); foreach my $key (keys(%{$access_controls{$file_name}})) { my ($num,$scope,$end,$start) = ($key =~ /^([^:]+):([a-z]+)_(\d*)_?(\d*)$/); + if (!$portaccess) { + next unless ($scope eq 'ip'); + } if ($start > $now) { next; }