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

raeburn raeburn at source.lon-capa.org
Sat May 17 17:43:55 EDT 2014


raeburn		Sat May 17 21:43:55 2014 EDT

  Modified files:              
    /loncom/auth	checkauthen.pm lonacc.pm 
  Log:
  - For public user (e.g., unauthenticated user viewing syllabus etc.) 
    set $r->user() to public:public, just in case there a username of
    "public" is a real institutional username (and SSO is in use).
  - Prevent public user being identified as SSO-authenticated user without
    LON-CAPA username. 
  
  
Index: loncom/auth/checkauthen.pm
diff -u loncom/auth/checkauthen.pm:1.15 loncom/auth/checkauthen.pm:1.16
--- loncom/auth/checkauthen.pm:1.15	Sun Jan  5 11:30:06 2014
+++ loncom/auth/checkauthen.pm	Sat May 17 21:43:55 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # checks for a cokkie to authenticate a user
 #
-# $Id: checkauthen.pm,v 1.15 2014/01/05 11:30:06 raeburn Exp $
+# $Id: checkauthen.pm,v 1.16 2014/05/17 21:43:55 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -38,14 +38,14 @@
 
     if ($r->uri() =~ m{^/res/adm/pages/[^/]+\.(gif|png)$}) {
         if ($r->user() eq '') {
-            $r->user('public');
+            $r->user('public:public');
         }
         return OK;
     }
 
     if (&Apache::lonnet::is_domainimage($r->uri)) {
         if ($r->user() eq '') {
-            $r->user('public');
+            $r->user('public:public');
         }
         return OK;
     }
@@ -66,7 +66,7 @@
 	&& $env{'user.domain'} eq 'public') {
 	if ($env{'request.publicaccess'} ) {
             if ($r->user() eq '') {
-                $r->user('public');
+                $r->user('public:public');
             }
 	    return OK;
 	} else {
Index: loncom/auth/lonacc.pm
diff -u loncom/auth/lonacc.pm:1.155 loncom/auth/lonacc.pm:1.156
--- loncom/auth/lonacc.pm:1.155	Mon May  5 23:17:12 2014
+++ loncom/auth/lonacc.pm	Sat May 17 21:43:55 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Cookie Based Access Handler
 #
-# $Id: lonacc.pm,v 1.155 2014/05/05 23:17:12 raeburn Exp $
+# $Id: lonacc.pm,v 1.156 2014/05/17 21:43:55 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -283,7 +283,7 @@
     my ($r,$handle,$username) = @_;
 
     my $lonidsdir=$r->dir_config('lonIDsDir');
-    if (($r->user eq '') || ($username ne '') ||
+    if (($r->user eq '') || ($username ne '') || ($r->user eq 'public:public') ||
         (defined($env{'user.name'}) && (defined($env{'user.domain'}))
 	  && ($handle ne ''))) {
 	# not an SSO case or already logged in




More information about the LON-CAPA-cvs mailing list