Diff for /loncom/auth/publiccheck.pm between versions 1.24 and 1.29

version 1.24, 2014/12/01 22:52:54 version 1.29, 2023/12/28 18:14:08
Line 92  sub process_public { Line 92  sub process_public {
         my $cookie=&Apache::lonauth::success($r,'public','public','public');          my $cookie=&Apache::lonauth::success($r,'public','public','public');
         my $lonidsdir=$r->dir_config('lonIDsDir');          my $lonidsdir=$r->dir_config('lonIDsDir');
         &Apache::lonnet::transfer_profile_to_env($lonidsdir,$cookie);          &Apache::lonnet::transfer_profile_to_env($lonidsdir,$cookie);
  $r->err_header_out('Set-cookie',"lonID=$cookie; path=/");   $r->err_header_out('Set-cookie',"lonPubID=$cookie; path=/; HttpOnly");
     }      }
     &Apache::lonacc::get_posted_cgi($r);      &Apache::lonacc::get_posted_cgi($r);
     $env{'request.state'} = "published";      $env{'request.state'} = "published";
Line 105  sub process_portfolio { Line 105  sub process_portfolio {
     my ($r,$udom,$unum,$file_name,$group) = @_;      my ($r,$udom,$unum,$file_name,$group) = @_;
     my $current_perms = &Apache::lonnet::get_portfile_permissions($udom,$unum);      my $current_perms = &Apache::lonnet::get_portfile_permissions($udom,$unum);
     my %access_controls = &Apache::lonnet::get_access_controls($current_perms,$group,$file_name);      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 $access = '';
     my $now = time;      my $now = time;
     my $clientip = $r->get_remote_host();      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}})) {      foreach my $key (keys(%{$access_controls{$file_name}})) {
         my ($num,$scope,$end,$start) = ($key =~ /^([^:]+):([a-z]+)_(\d*)_?(\d*)$/);          my ($num,$scope,$end,$start) = ($key =~ /^([^:]+):([a-z]+)_(\d*)_?(\d*)$/);
           if (!$portaccess) {
               next unless ($scope eq 'ip');
           }
         if ($start > $now) {          if ($start > $now) {
             next;              next;
         }          }
Line 120  sub process_portfolio { Line 125  sub process_portfolio {
             $access = 'public';              $access = 'public';
             last;              last;
         }          }
         if ($scope eq 'ip') {          if (($scope eq 'ip') || ($scope eq 'userip')) {
             if (ref($access_controls{$file_name}{$key}) eq 'HASH') {              if (ref($access_controls{$file_name}{$key}) eq 'HASH') {
                 if (ref($access_controls{$file_name}{$key}{'ip'}) eq 'ARRAY') {                  if (ref($access_controls{$file_name}{$key}{'ip'}) eq 'ARRAY') {
                     if (&Apache::loncommon::check_ip_acc(join(',',@{$access_controls{$file_name}{$key}{'ip'}}),$clientip)) {                      if (&Apache::loncommon::check_ip_acc(join(',',@{$access_controls{$file_name}{$key}{'ip'}}),$clientip)) {

Removed from v.1.24  
changed lines
  Added in v.1.29


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>