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

raeburn raeburn at source.lon-capa.org
Tue Feb 5 16:32:50 EST 2013


raeburn		Tue Feb  5 21:32:50 2013 EDT

  Modified files:              
    /loncom/auth	publiccheck.pm lonacc.pm 
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - Apache 2.4 requires $r->user() to be set, if "Require valid-user" applies to
    the requested page, otherwise there is an error:
    "No authentication done but request not allowed without authentication". 
  
  
Index: loncom/auth/publiccheck.pm
diff -u loncom/auth/publiccheck.pm:1.19 loncom/auth/publiccheck.pm:1.20
--- loncom/auth/publiccheck.pm:1.19	Wed Mar 17 19:41:11 2010
+++ loncom/auth/publiccheck.pm	Tue Feb  5 21:32:45 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Cookie Based Access Handler
 #
-# $Id: publiccheck.pm,v 1.19 2010/03/17 19:41:11 raeburn Exp $
+# $Id: publiccheck.pm,v 1.20 2013/02/05 21:32:45 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -44,10 +44,16 @@
     my $requrl=$r->uri;
 
     if (&Apache::lonnet::is_domainimage($requrl)) {
+        if ($r->user() eq '') {
+            $r->user('public');
+        }
         return OK;
     }
 
     if ($requrl =~ m{^/res/adm/pages/[^/]+\.(gif|png)$}) {
+        if ($r->user() eq '') {
+            $r->user('public');
+        }
         return OK;
     }
 
Index: loncom/auth/lonacc.pm
diff -u loncom/auth/lonacc.pm:1.142 loncom/auth/lonacc.pm:1.143
--- loncom/auth/lonacc.pm:1.142	Wed Jan 30 16:23:47 2013
+++ loncom/auth/lonacc.pm	Tue Feb  5 21:32:45 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Cookie Based Access Handler
 #
-# $Id: lonacc.pm,v 1.142 2013/01/30 16:23:47 raeburn Exp $
+# $Id: lonacc.pm,v 1.143 2013/02/05 21:32:45 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -275,9 +275,9 @@
     my ($r,$handle) = @_;
 
     my $lonidsdir=$r->dir_config('lonIDsDir');
-    if (!($r->user 
-	  && (!defined($env{'user.name'}) && !defined($env{'user.domain'}))
-	  && ($handle eq ''))) {
+    if (($r->user eq '') ||
+        (defined($env{'user.name'}) && (defined($env{'user.domain'}))
+	  && ($handle ne ''))) {
 	# not an SSO case or already logged in
 	return undef;
     }
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1211 loncom/lonnet/perl/lonnet.pm:1.1212
--- loncom/lonnet/perl/lonnet.pm:1.1211	Sat Feb  2 03:29:33 2013
+++ loncom/lonnet/perl/lonnet.pm	Tue Feb  5 21:32:49 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1211 2013/02/02 03:29:33 raeburn Exp $
+# $Id: lonnet.pm,v 1.1212 2013/02/05 21:32:49 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -634,6 +634,13 @@
 	|| !defined($disk_env{'user.domain'})) {
 	return undef;
     }
+    if ($r->user() eq '') {
+        if ($disk_env{'user.domain'} eq $r->dir_config('lonDefDomain')) {
+            $r->user($disk_env{'user.name'});
+        } else {
+            $r->user($disk_env{'user.name'}.':'.$disk_env{'user.domain'});
+        }
+    }
     return $handle;
 }
 




More information about the LON-CAPA-cvs mailing list