--- loncom/auth/lonacc.pm 2009/10/20 01:57:38 1.129 +++ loncom/auth/lonacc.pm 2011/11/18 22:41:02 1.130.6.1 @@ -1,7 +1,7 @@ # The LearningOnline Network # Cookie Based Access Handler # -# $Id: lonacc.pm,v 1.129 2009/10/20 01:57:38 raeburn Exp $ +# $Id: lonacc.pm,v 1.130.6.1 2011/11/18 22:41:02 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -449,8 +449,16 @@ sub handler { return OK; } if (($access ne '2') && ($access ne 'F')) { - $env{'user.error.msg'}="$requrl:bre:1:1:Access Denied"; - return HTTP_NOT_ACCEPTABLE; + if ($requrl =~ m{^/res/}) { + $access = &Apache::lonnet::allowed('bro',$requrl); + if ($access ne 'F') { + $env{'user.error.msg'}="$requrl:bre:1:1:Access Denied"; + return HTTP_NOT_ACCEPTABLE; + } + } else { + $env{'user.error.msg'}="$requrl:bre:1:1:Access Denied"; + return HTTP_NOT_ACCEPTABLE; + } } } if ($requrl =~ m|^/prtspool/|) { @@ -481,7 +489,14 @@ sub handler { } # ------------------------------------------------------------- This is allowed if ($env{'request.course.id'}) { - &Apache::lonnet::countacc($requrl); + my $skiplogging; + if ((!&Apache::loncommon::needs_gci_custom()) && + ($env{'course.'.$env{'request.course.id'}.'.internal.courseowner'} ne $env{'user.name'}.':'.$env{'user.domain'})) { + $skiplogging = 1; + } + unless ($skiplogging) { + &Apache::lonnet::countacc($requrl); + } $requrl=~/\.(\w+)$/; my $query=$r->args; if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') || @@ -532,10 +547,14 @@ sub handler { } } $env{'request.symb'}=$symb; - &Apache::lonnet::courseacclog($symb); + unless ($skiplogging) { + &Apache::lonnet::courseacclog($symb); + } } else { # ------------------------------------------------------- This is other content - &Apache::lonnet::courseacclog($requrl); + unless ($skiplogging) { + &Apache::lonnet::courseacclog($requrl); + } } my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};; my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};;