version 1.28, 2002/02/26 21:01:33
|
version 1.35, 2002/08/27 14:23:18
|
Line 172 sub handler {
|
Line 172 sub handler {
|
$requrl=~/\.(\w+)$/; |
$requrl=~/\.(\w+)$/; |
if (&Apache::loncommon::fileembstyle($1) eq 'ssi') { |
if (&Apache::loncommon::fileembstyle($1) eq 'ssi') { |
# ------------------------------------- This is serious stuff, get symb and log |
# ------------------------------------- This is serious stuff, get symb and log |
my $symb=&Apache::lonnet::symbread; |
my $query=$r->args; |
|
my $symb; |
|
if ($query) { |
|
&Apache::loncommon::get_unprocessed_cgi($query,['symb']); |
|
} |
|
if ($ENV{'form.symb'}) { |
|
$symb=&Apache::lonnet::symbclean($ENV{'form.symb'}); |
|
if (&Apache::lonnet::symbverify($symb,$requrl)) { |
|
my ($map,$mid,$murl)=split(/\_\_\_/,$symb); |
|
&Apache::lonnet::symblist($map,$murl => $mid, |
|
'last_known' => $murl); |
|
} else { |
|
$r->log_reason('Invalid symb for '.$requrl.': '. |
|
$symb); |
|
$ENV{'user.error.msg'}= |
|
"$requrl:bre:1:1:Invalid Access"; |
|
return HTTP_NOT_ACCEPTABLE; |
|
} |
|
} else { |
|
$symb=&Apache::lonnet::symbread; |
|
} |
$ENV{'request.symb'}=$symb; |
$ENV{'request.symb'}=$symb; |
&Apache::lonnet::courseacclog($symb); |
&Apache::lonnet::courseacclog($symb); |
} else { |
} else { |
Line 187 sub handler {
|
Line 207 sub handler {
|
} |
} |
|
|
# -------------------------------------------- See if this is a public resource |
# -------------------------------------------- See if this is a public resource |
if (&Apache::lonnet::metadata($requrl,'copyright') eq 'public') { |
if (($requrl=~/^\/public\//) || |
|
(&Apache::lonnet::metadata($requrl,'copyright') eq 'public')) { |
&Apache::lonnet::logthis('Granting public access: '.$requrl); |
&Apache::lonnet::logthis('Granting public access: '.$requrl); |
$ENV{'user.name'}='public'; |
$ENV{'user.name'}='public'; |
$ENV{'user.domain'}='public'; |
$ENV{'user.domain'}='public'; |
Line 196 sub handler {
|
Line 217 sub handler {
|
$ENV{'request.filename'} = $r->filename; |
$ENV{'request.filename'} = $r->filename; |
return OK; |
return OK; |
} |
} |
# ----------------------------------------------- Store where they wanted to go |
# -------------------------------------------------------------- Not authorized |
|
$requrl=~/\.(\w+)$/; |
$ENV{'request.firsturl'}=$requrl; |
if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') || |
return FORBIDDEN; |
($requrl=~/^\/adm\/(roles|logout)/)) { |
|
# -------------------------- Store where they wanted to go and get login screen |
|
$ENV{'request.firsturl'}=$requrl; |
|
return FORBIDDEN; |
|
} else { |
|
# --------------------------------------------------------------------- Goodbye |
|
return HTTP_BAD_REQUEST; |
|
} |
} |
} |
|
|
1; |
1; |