Diff for /loncom/auth/lonroles.pm between versions 1.350 and 1.351

version 1.350, 2021/06/12 23:14:56 version 1.351, 2021/07/19 14:26:40
Line 902  ENDCLOSE Line 902  ENDCLOSE
     }      }
  }   }
                                 # Are we allowed to look at the first resource?                                  # Are we allowed to look at the first resource?
                                 my $access;                                  #
                                 if ($furl =~ m{^(/adm/wrapper|)/ext/}) {                                  # $furl returned by lonuserstate::readmap() has format:
                                     # If it's an external resource,                                  # $url?symb=escaped($symb). If the resource has the 
                                     # strip off the symb argument and possible query                                  # encrypturl parameter in effect, the entire string
                                     my ($exturl,$symb) = ($furl =~ m{^(.+)(?:\?|\&)symb=(.+)$});                                  # $url?symb=escaped($symb) is encrypted as a string
                                     # Unencode $symb                                  # beginning /enc/.
                                     $symb = &unescape($symb);                                  # 
                                     # Then check for permission                                  my ($access,$unencfurl,$unencsymb);
                                     $access = &Apache::lonnet::allowed('bre',$exturl,$symb);                                  if ($furl =~ m{^(.+)(?:\?|\&)symb=([^&]+)(?:$|&)}) {
                                 # For other resources just check for permission                                      my ($poss_url,$poss_symb) = ($1,$2);
                                       $unencsymb = &unescape($poss_symb);
                                       $unencfurl = $poss_url;
                                   } elsif ($furl =~ m{^/enc/}) {
                                       my $unenc = &Apache::lonenc::unencrypted($furl);
                                       if ($unenc =~ m{^(.+)(?:\?|\&)symb=([^&]+)(?:$|&)}) {
                                           ($unencfurl,$unencsymb) = ($1,$2);
                                           $unencsymb = &unescape($unencsymb);
                                       } else {
                                           $unencfurl = $unenc;
                                       }
                                 } else {                                  } else {
                                     $access = &Apache::lonnet::allowed('bre',$furl);                                      $unencfurl = $furl;
                                 }                                  }
                                 if ((!$access) || ($access eq 'D')) {                                  if ($unencsymb) {
                                       my $symb = &Apache::lonnet::symbclean($unencsymb);
                                       if (($symb ne '') && (&Apache::lonnet::symbverify($symb,$unencfurl))) {
                                           $access = &Apache::lonnet::allowed('bre',$unencfurl,$symb);
                                       } else {
                                           $access = &Apache::lonnet::allowed('bre',$unencfurl);
                                       }
                                   } else {
                                       $access = &Apache::lonnet::allowed('bre',$unencfurl);
                                   }
                                   if ((!$access) || ($access eq 'B') || ($access eq 'D')) {
                                     $furl = &Apache::lonpageflip::first_accessible_resource();                                      $furl = &Apache::lonpageflip::first_accessible_resource();
                                 } elsif ($access eq 'B') {                                      if ($furl eq '') {
                                     $furl = '/adm/navmaps?showOnlyHomework=1';                                          $furl = '/adm/navmaps?showOnlyHomework=1';
                                       }
                                 }                                  }
                                 if ($env{'request.lti.login'}) {                                  if ($env{'request.lti.login'}) {
                                     undef($msg);                                      undef($msg);

Removed from v.1.350  
changed lines
  Added in v.1.351


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