version 1.10, 2006/01/16 19:27:09
|
version 1.14, 2011/10/21 16:03:06
|
Line 32 use strict;
|
Line 32 use strict;
|
use Apache::Constants qw(:common :remotehost); |
use Apache::Constants qw(:common :remotehost); |
use Apache::lonnet(); |
use Apache::lonnet(); |
use Apache::File(); |
use Apache::File(); |
use Apache::loncommon; |
use LONCAPA; |
|
|
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
|
# FIXME line remove when mod_perl fixes BUG#4948 |
|
$r->notes->set('error-notes' => ''); |
if ($r->uri=~m|^(/raw)?/uploaded/|) { |
if ($r->uri=~m|^(/raw)?/uploaded/|) { |
my $fn = $r->uri(); |
my $fn = $r->uri(); |
$fn=~s/^\/raw//; |
$fn=~s/^\/raw//; |
Line 46 sub handler {
|
Line 49 sub handler {
|
my @ids=&Apache::lonnet::current_machine_ids(); |
my @ids=&Apache::lonnet::current_machine_ids(); |
foreach my $id (@ids) { if ($id eq $chome) { $allowed=1; } } |
foreach my $id (@ids) { if ($id eq $chome) { $allowed=1; } } |
if ($allowed) { |
if ($allowed) { |
$r->filename(&Apache::loncommon::propath($udom,$uname). |
$r->filename(&propath($udom,$uname). |
'/userfiles/'.(join('/',@ufile))); |
'/userfiles/'.(join('/',@ufile))); |
} |
} |
} elsif ($r->uri=~m|^/~|) { |
|
#internal authentication, needs fixup. |
|
my $fn = $r->uri(); # non users do not get the full path request |
|
# through SCRIPT_FILENAME |
|
$fn=~s|^/~(\w+)|/home/$1/public_html|; |
|
$r->filename($fn); |
|
} else { return DECLINED; } |
} else { return DECLINED; } |
return OK; |
return OK; |
} |
} |