version 1.48, 2003/09/20 17:44:22
|
version 1.60, 2005/01/28 09:30:40
|
Line 70 sub handler {
|
Line 70 sub handler {
|
|
|
# -------------------------------------------------------------- Resource State |
# -------------------------------------------------------------- Resource State |
|
|
if ($requrl=~/^\/res\//) { |
if ($requrl=~/^\/+(res|uploaded)\//) { |
$ENV{'request.state'} = "published"; |
$ENV{'request.state'} = "published"; |
} else { |
} else { |
$ENV{'request.state'} = 'unknown'; |
$ENV{'request.state'} = 'unknown'; |
} |
} |
$ENV{'request.filename'} = $r->filename; |
$ENV{'request.filename'} = $r->filename; |
|
$ENV{'request.noversionuri'} = &Apache::lonnet::deversion($requrl); |
# -------------------------------------------------------- Load POST parameters |
# -------------------------------------------------------- Load POST parameters |
|
|
&Apache::loncommon::get_posted_cgi($r); |
&Apache::loncommon::get_posted_cgi($r); |
Line 109 sub handler {
|
Line 109 sub handler {
|
if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') || |
if ((&Apache::loncommon::fileembstyle($1) eq 'ssi') || |
($requrl=~/^\/adm\/.*\/(aboutme|navmaps|smppg|bulletinboard)(\?|$)/) || |
($requrl=~/^\/adm\/.*\/(aboutme|navmaps|smppg|bulletinboard)(\?|$)/) || |
($requrl=~/^\/adm\/wrapper\//) || |
($requrl=~/^\/adm\/wrapper\//) || |
|
($requrl=~m|\.problem/smpedit$|) || |
($requrl=~/^\/public\/.*\/syllabus$/)) { |
($requrl=~/^\/public\/.*\/syllabus$/)) { |
# ------------------------------------- This is serious stuff, get symb and log |
# ------------------------------------- This is serious stuff, get symb and log |
my $query=$r->args; |
my $query=$r->args; |
Line 118 sub handler {
|
Line 119 sub handler {
|
} |
} |
if ($ENV{'form.symb'}) { |
if ($ENV{'form.symb'}) { |
$symb=&Apache::lonnet::symbclean($ENV{'form.symb'}); |
$symb=&Apache::lonnet::symbclean($ENV{'form.symb'}); |
if (&Apache::lonnet::symbverify($symb,$requrl)) { |
if ($requrl =~ m|^/adm/wrapper/|) { |
my ($map,$mid,$murl)=split(/\_\_\_/,$symb); |
my ($map,$mid,$murl)=&Apache::lonnet::decode_symb($symb); |
|
&Apache::lonnet::symblist($map,$murl => $mid, |
|
'last_known' => $murl); |
|
} elsif ((&Apache::lonnet::symbverify($symb,$requrl)) || |
|
(($requrl=~m|(.*)/smpedit$|) && |
|
&Apache::lonnet::symbverify($symb,$1))) { |
|
my ($map,$mid,$murl)=&Apache::lonnet::decode_symb($symb); |
&Apache::lonnet::symblist($map,$murl => $mid, |
&Apache::lonnet::symblist($map,$murl => $mid, |
'last_known' => $murl); |
'last_known' => $murl); |
} else { |
} else { |
Line 131 sub handler {
|
Line 138 sub handler {
|
} |
} |
} else { |
} else { |
$symb=&Apache::lonnet::symbread($requrl); |
$symb=&Apache::lonnet::symbread($requrl); |
|
if (&Apache::lonnet::is_on_map($requrl) && $symb && |
|
!&Apache::lonnet::symbverify($symb,$requrl)) { |
|
$r->log_reason('Invalid symb for '.$requrl.': '.$symb); |
|
$ENV{'user.error.msg'}= |
|
"$requrl:bre:1:1:Invalid Access"; |
|
return HTTP_NOT_ACCEPTABLE; |
|
} |
my ($map,$mid,$murl)=split(/\_\_\_/,$symb); |
my ($map,$mid,$murl)=split(/\_\_\_/,$symb); |
&Apache::lonnet::symblist($map,$murl => $mid, |
&Apache::lonnet::symblist($map,$murl => $mid, |
'last_known' => $murl); |
'last_known' => $murl); |
Line 152 sub handler {
|
Line 166 sub handler {
|
if ($requrl=~m|^/public/| |
if ($requrl=~m|^/public/| |
|| (&Apache::lonnet::metadata($requrl,'copyright') eq 'public')) { |
|| (&Apache::lonnet::metadata($requrl,'copyright') eq 'public')) { |
&Apache::lonnet::logthis('Granting public access: '.$requrl); |
&Apache::lonnet::logthis('Granting public access: '.$requrl); |
my $buffer; |
&Apache::loncommon::get_posted_cgi($r); |
$r->read($buffer,$r->header_in('Content-length'),0); |
|
&Apache::loncommon::get_unprocessed_cgi($buffer); |
|
$ENV{'user.name'}='public'; |
$ENV{'user.name'}='public'; |
$ENV{'user.domain'}='public'; |
$ENV{'user.domain'}='public'; |
$ENV{'request.state'} = "published"; |
$ENV{'request.state'} = "published"; |
$ENV{'request.publicaccess'} = 1; |
$ENV{'request.publicaccess'} = 1; |
$ENV{'request.filename'} = $r->filename; |
$ENV{'request.filename'} = $r->filename; |
|
my ($httpbrowser, $clientbrowser, $clientversion, |
|
$clientmathml, $clientunicode, $clientos) = |
|
&Apache::loncommon::decode_user_agent($r); |
|
$ENV{'browser.type'}=$clientbrowser; |
|
$ENV{'browser.version'}=$clientversion; |
|
$ENV{'browser.mathml'}=$clientmathml; |
|
$ENV{'browser.unicode'}=$clientunicode; |
|
$ENV{'browser.os'}=$clientos; |
|
|
return OK; |
return OK; |
} |
} |
# -------------------------------------------------------------- Not authorized |
# -------------------------------------------------------------- Not authorized |