version 1.110, 2011/10/23 23:46:07
|
version 1.111, 2011/10/24 22:39:21
|
Line 189 sub display {
|
Line 189 sub display {
|
sub obsolete_unpub { |
sub obsolete_unpub { |
my ($user,$domain,$construct)=@_; |
my ($user,$domain,$construct)=@_; |
my $published=$construct; |
my $published=$construct; |
$published=~ |
$published=~s/^\/home\/httpd\/html\/priv\//\/home\/httpd\/html\/res\//; |
s/^\/home\/$user\/public\_html\//\/home\/httpd\/html\/res\/$domain\/$user\//; |
|
if (-e $published) { |
if (-e $published) { |
if (&Apache::lonnet::metadata($published,'obsolete')) { |
if (&Apache::lonnet::metadata($published,'obsolete')) { |
return 1; |
return 1; |
Line 404 sub relativeDest {
|
Line 403 sub relativeDest {
|
while ($newfilename=~m:/\.\./:) { |
while ($newfilename=~m:/\.\./:) { |
$newfilename=~ s:/[^/]+/\.\./:/:g; #remove dir/.. |
$newfilename=~ s:/[^/]+/\.\./:/:g; #remove dir/.. |
} |
} |
if ($newfilename =~ m{^/home/($match_username)/(?:public\_html|priv)/}) { |
my ($authorname,$authordom)=&Apache::loncacc::constructaccess($newfilename); |
my $otheruname = $1; |
unless (($authorname) && ($authordom)) { |
unless ($otheruname eq $uname) { |
my $otherdir = &display($newfilename); |
my ($authorname,$authordom)= |
$error = &mt('Access denied to [_1]',$otherdir); |
&Apache::loncacc::constructaccess($newfilename,$env{'request.role.domain'}); |
|
unless (($authorname eq $otheruname) && ($authordom ne '')) { |
|
my $otherdir = &display($newfilename); |
|
$error = &mt('Access denied to [_1]',$otherdir); |
|
} |
|
} |
|
} |
} |
return ($newfilename,$error); |
return ($newfilename,$error); |
} |
} |
Line 1445 sub handler {
|
Line 1438 sub handler {
|
my $uname; |
my $uname; |
my $udom; |
my $udom; |
|
|
($uname,$udom)= |
($uname,$udom)=&Apache::loncacc::constructaccess($fn); |
&Apache::loncacc::constructaccess($fn,$r->dir_config('lonDefDomain')); |
|
&Debug($r, |
&Debug($r, |
"loncfile::handler constructaccess uname = $uname domain = $udom"); |
"loncfile::handler constructaccess uname = $uname domain = $udom"); |
unless (($uname) && ($udom)) { |
unless (($uname) && ($udom)) { |