[LON-CAPA-cvs] cvs: loncom /auth lonacc.pm

raeburn raeburn at source.lon-capa.org
Sat Oct 18 17:40:06 EDT 2014


raeburn		Sat Oct 18 21:40:06 2014 EDT

  Modified files:              
    /loncom/auth	lonacc.pm 
  Log:
  - Eliminate "Cookie not valid" log spew in web server error logs for 
    unauthenticated access of public content.
  
  
Index: loncom/auth/lonacc.pm
diff -u loncom/auth/lonacc.pm:1.158 loncom/auth/lonacc.pm:1.159
--- loncom/auth/lonacc.pm:1.158	Sat Oct  4 02:59:32 2014
+++ loncom/auth/lonacc.pm	Sat Oct 18 21:40:06 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Cookie Based Access Handler
 #
-# $Id: lonacc.pm,v 1.158 2014/10/04 02:59:32 raeburn Exp $
+# $Id: lonacc.pm,v 1.159 2014/10/18 21:40:06 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -445,7 +445,10 @@
     my ($is_balancer,$otherserver);
 
     if ($handle eq '') {
-        unless (($requrl eq '/adm/switchserver') && (!$r->is_initial_req())) {
+        unless ((($requrl eq '/adm/switchserver') && (!$r->is_initial_req())) ||
+                ($requrl =~ m{^/public/$match_domain/$match_courseid/syllabus}) ||
+                ($requrl =~ m{^/adm/help/}) ||
+                ($requrl =~ m{^/res/$match_domain/$match_username/})) {
 	    $r->log_reason("Cookie not valid", $r->filename);
         }
     } elsif ($handle ne '') {
@@ -566,6 +569,13 @@
 	if ($requrl !~ m{^/(?:adm|public|prtspool)/}
 	    || $requrl =~ /^\/adm\/.*\/(smppg|bulletinboard)(\?|$ )/x) {
 	    my $access=&Apache::lonnet::allowed('bre',$requrl);
+            if ($handle eq '') {
+                unless ($access eq 'F') {
+                    if ($requrl =~ m{^/res/$match_domain/$match_username/}) {
+                        $r->log_reason("Cookie not valid", $r->filename);
+                    }
+                }
+            }
 	    if ($access eq '1') {
 		$env{'user.error.msg'}="$requrl:bre:0:0:Choose Course";
 		return HTTP_NOT_ACCEPTABLE; 




More information about the LON-CAPA-cvs mailing list