Diff for /loncom/auth/lonacc.pm between versions 1.64 and 1.69

version 1.64, 2005/04/07 06:56:20 version 1.69, 2005/11/23 20:46:04
Line 25 Line 25
 #  #
 # http://www.lon-capa.org/  # http://www.lon-capa.org/
 #  #
 # YEAR=1999  
 # 5/21/99,5/22,5/29,5/31,6/15,16/11,22/11,  
 # YEAR=2000  
 # 01/06,01/13,05/31,06/01,09/06,09/25,09/28,10/30,11/6,  
 # 12/25,12/26,  
 # YEAR=2001  
 # 01/06/01,05/28,8/11,9/26,11/29 Gerd Kortemeyer  
 # YEAR=2002  
 # 1/4,2/25 Gerd Kortemeyer  
 #  
 ###  ###
   
 package Apache::lonacc;  package Apache::lonacc;
Line 102  sub handler { Line 92  sub handler {
     return HTTP_NOT_ACCEPTABLE;      return HTTP_NOT_ACCEPTABLE;
  }   }
     }      }
       if ($env{'user.name'} eq 'public' && 
    $env{'user.domain'} eq 'public' &&
    $requrl !~ m{^/+(res|public)/} &&
    $requrl !~ m{^/+adm/(help|logout|randomlabel\.png)}) {
    $env{'request.querystring'}=$r->args;
    $env{'request.firsturl'}=$requrl;
    return FORBIDDEN;
       }
 # ------------------------------------------------------------- This is allowed  # ------------------------------------------------------------- This is allowed
           if ($env{'request.course.id'}) {            if ($env{'request.course.id'}) {
     &Apache::lonnet::countacc($requrl);      &Apache::lonnet::countacc($requrl);
Line 146  sub handler { Line 144  sub handler {
                  return HTTP_NOT_ACCEPTABLE;                    return HTTP_NOT_ACCEPTABLE; 
     }      }
     if ($symb) {      if ($symb) {
  my ($map,$mid,$murl)=split(/\_\_\_/,$symb);   my ($map,$mid,$murl)=
       &Apache::lonnet::decode_symb($symb);
  &Apache::lonnet::symblist($map,$murl =>[$murl,$mid],   &Apache::lonnet::symblist($map,$murl =>[$murl,$mid],
  'last_known' =>[$murl,$mid]);   'last_known' =>[$murl,$mid]);
     }      }
Line 168  sub handler { Line 167  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 $cookie=
       &Apache::lonauth::success($r,'public','public','public');
           my $lonidsdir=$r->dir_config('lonIDsDir');
    &Apache::lonnet::transfer_profile_to_env($lonidsdir,$cookie);
  &Apache::loncommon::get_posted_cgi($r);   &Apache::loncommon::get_posted_cgi($r);
  $env{'user.name'}='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;  
   
    $r->header_out('Set-cookie',"lonID=$cookie; path=/");
         return OK;          return OK;
     }      }
       if ($requrl=~m|^/+adm/+help/+|) {
    return OK;
       }
 # -------------------------------------------------------------- Not authorized  # -------------------------------------------------------------- Not authorized
     $requrl=~/\.(\w+)$/;      $requrl=~/\.(\w+)$/;
 #    if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') ||  #    if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') ||

Removed from v.1.64  
changed lines
  Added in v.1.69


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