version 1.10, 2003/05/27 18:31:31
|
version 1.12, 2004/04/26 00:07:29
|
Line 25
|
Line 25
|
# |
# |
# http://www.lon-capa.org/ |
# http://www.lon-capa.org/ |
# |
# |
# (lonacc: Cookie Based Access Handler |
|
# 5/21/99,5/22,5/29,5/31,6/15 Gerd Kortemeyer) |
|
# 6/16,6/18,7/3, |
|
# 6/30/00 Gerd Kortemeyer |
|
|
|
package Apache::lonracc; |
package Apache::lonracc; |
|
|
Line 60 sub handler {
|
Line 56 sub handler {
|
$r->log_reason("Spoof request from ".$ENV{'REMOTE_ADDR'}); |
$r->log_reason("Spoof request from ".$ENV{'REMOTE_ADDR'}); |
return FORBIDDEN; |
return FORBIDDEN; |
} |
} |
|
if ($reqhost eq 'localhost.localdomain') { |
|
return OK; |
|
} |
my $readline; |
my $readline; |
my $lontabdir=$r->dir_config('lonTabDir'); |
my $lontabdir=$r->dir_config('lonTabDir'); |
{ |
{ |
Line 74 sub handler {
|
Line 73 sub handler {
|
my ($id,$domain,$role,$name,$ip)=split(/:/,$readline); |
my ($id,$domain,$role,$name,$ip)=split(/:/,$readline); |
if ($name =~ /$reqhost/i) { |
if ($name =~ /$reqhost/i) { |
my $filename=$r->filename; |
my $filename=$r->filename; |
|
my $uri =$r->uri; |
if ((-e "$filename.$id") || |
if ((-e "$filename.$id") || |
&subscribed($filename,$id) || |
&subscribed($filename,$id) || |
($filename=~/\.meta$/)) { |
($filename=~/\.meta$/) || |
|
($uri=~m|^/raw/uploaded|)) { |
return OK; |
return OK; |
} else { |
} else { |
$return=FORBIDDEN; |
$return=FORBIDDEN; |