[LON-CAPA-cvs] cvs: loncom /auth loncacc.pm
raeburn
raeburn at source.lon-capa.org
Sun Oct 30 16:31:02 EDT 2011
raeburn Sun Oct 30 20:31:02 2011 EDT
Modified files:
/loncom/auth loncacc.pm
Log:
- Update documentation
- Use lonDocRoot perlvar in place of static string: '/home/httpd/html'
- Coding style: eliminate leaning toothpicks.
Index: loncom/auth/loncacc.pm
diff -u loncom/auth/loncacc.pm:1.56 loncom/auth/loncacc.pm:1.57
--- loncom/auth/loncacc.pm:1.56 Tue Oct 25 18:37:11 2011
+++ loncom/auth/loncacc.pm Sun Oct 30 20:31:02 2011
@@ -2,7 +2,7 @@
# Cookie Based Access Handler for Construction Area
# (lonacc: 5/21/99,5/22,5/29,5/31 Gerd Kortemeyer)
#
-# $Id: loncacc.pm,v 1.56 2011/10/25 18:37:11 www Exp $
+# $Id: loncacc.pm,v 1.57 2011/10/30 20:31:02 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -42,11 +42,11 @@
=head1 INTRODUCTION
This module enables cookie based authentication for construction area
-and is used to control access for three (essentially equivalent) URIs.
+and is used to control access for the following two types of URI
+(one for files, and one for directories):
<LocationMatch "^/priv.*">
- <LocationMatch "^/\~.*">
- <LocationMatch "^/\~.*/$">
+ <LocationMatch "^/priv.*/$">
Whenever the client sends the cookie back to the server,
if the cookie is missing or invalid, the user is re-challenged
@@ -103,7 +103,8 @@
if ($url=~/\.(\d+)\.(\w+)$/) { return ''; }
# Get username and domain from URL
- my ($ownerdomain,$ownername)=($url=~/^(?:\/home\/httpd\/html\/|\/)priv\/($match_domain)\/($match_username)\//);
+ my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'};
+ my ($ownerdomain,$ownername)=($url=~ m{^(?:\Q$londocroot\E|)/priv/($match_domain)/($match_username)/});
# The URL does not really point to any authorspace, forget it
unless (($ownername) && ($ownerdomain)) { return ''; }
More information about the LON-CAPA-cvs
mailing list