Diff for /loncom/auth/lonacc.pm between versions 1.56 and 1.60.2.1

version 1.56, 2004/12/23 19:40:12 version 1.60.2.1, 2005/02/21 18:22:04
Line 52  sub handler { Line 52  sub handler {
     my $r = shift;      my $r = shift;
     my $requrl=$r->uri;      my $requrl=$r->uri;
     my %cookies=CGI::Cookie->parse($r->header_in('Cookie'));      my %cookies=CGI::Cookie->parse($r->header_in('Cookie'));
       if ($r->header_in('User-Agent')=~/NSDL\_Search\_Bot/) {
          return OK;
       }
     my $lonid=$cookies{'lonID'};      my $lonid=$cookies{'lonID'};
     my $cookie;      my $cookie;
     if ($lonid) {      if ($lonid) {
Line 138  sub handler { Line 141  sub handler {
                     }                      }
                 } else {                  } else {
             $symb=&Apache::lonnet::symbread($requrl);              $symb=&Apache::lonnet::symbread($requrl);
     if ($requrl !~ m|^/res/adm/| &&      if (&Apache::lonnet::is_on_map($requrl) && $symb &&
  !&Apache::lonnet::symbverify($symb,$requrl)) {   !&Apache::lonnet::symbverify($symb,$requrl)) {
  $r->log_reason('Invalid symb for '.$requrl.': '.   $r->log_reason('Invalid symb for '.$requrl.': '.$symb);
                                        $symb);  
         $ENV{'user.error.msg'}=          $ENV{'user.error.msg'}=
                                 "$requrl:bre:1:1:Invalid Access";                                  "$requrl:bre:1:1:Invalid Access";
                  return HTTP_NOT_ACCEPTABLE;                    return HTTP_NOT_ACCEPTABLE; 
Line 167  sub handler { Line 169  sub handler {
     if ($requrl=~m|^/public/|      if ($requrl=~m|^/public/|
  || (&Apache::lonnet::metadata($requrl,'copyright') eq 'public')) {   || (&Apache::lonnet::metadata($requrl,'copyright') eq 'public')) {
         &Apache::lonnet::logthis('Granting public access: '.$requrl);          &Apache::lonnet::logthis('Granting public access: '.$requrl);
  my $buffer;   &Apache::loncommon::get_posted_cgi($r);
  $r->read($buffer,$r->header_in('Content-length'),0);  
  &Apache::loncommon::get_unprocessed_cgi($buffer);  
  $ENV{'user.name'}='public';   $ENV{'user.name'}='public';
         $ENV{'user.domain'}='public';          $ENV{'user.domain'}='public';
         $ENV{'request.state'} = "published";          $ENV{'request.state'} = "published";
         $ENV{'request.publicaccess'} = 1;          $ENV{'request.publicaccess'} = 1;
         $ENV{'request.filename'} = $r->filename;          $ENV{'request.filename'} = $r->filename;
    my ($httpbrowser,  $clientbrowser, $clientversion,
       $clientmathml, $clientunicode, $clientos) =
    &Apache::loncommon::decode_user_agent($r);
    $ENV{'browser.type'}=$clientbrowser;
           $ENV{'browser.version'}=$clientversion;
           $ENV{'browser.mathml'}=$clientmathml;
           $ENV{'browser.unicode'}=$clientunicode;
           $ENV{'browser.os'}=$clientos;
   
         return OK;          return OK;
     }      }
 # -------------------------------------------------------------- Not authorized  # -------------------------------------------------------------- Not authorized
     $requrl=~/\.(\w+)$/;      $requrl=~/\.(\w+)$/;
     if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') ||  #    if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') ||
         ($requrl=~/^\/adm\/(roles|logout|email|menu|remote)/) ||  #        ($requrl=~/^\/adm\/(roles|logout|email|menu|remote)/) ||
         ($requrl=~m|^/prtspool/|)) {  #        ($requrl=~m|^/prtspool/|)) {
 # -------------------------- Store where they wanted to go and get login screen  # -------------------------- Store where they wanted to go and get login screen
  $ENV{'request.querystring'}=$r->args;   $ENV{'request.querystring'}=$r->args;
  $ENV{'request.firsturl'}=$requrl;   $ENV{'request.firsturl'}=$requrl;
        return FORBIDDEN;         return FORBIDDEN;
    } else {  #   } else {
 # --------------------------------------------------------------------- Goodbye  # --------------------------------------------------------------------- Goodbye
        return HTTP_BAD_REQUEST;  #       return HTTP_BAD_REQUEST;
    }  #   }
 }  }
   
 1;  1;

Removed from v.1.56  
changed lines
  Added in v.1.60.2.1


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