version 1.113, 2011/11/02 19:12:40
|
version 1.116, 2012/10/29 17:38:55
|
Line 68 use File::Basename;
|
Line 68 use File::Basename;
|
use File::Copy; |
use File::Copy; |
use HTML::Entities(); |
use HTML::Entities(); |
use Apache::Constants qw(:common :http :methods); |
use Apache::Constants qw(:common :http :methods); |
use Apache::loncacc; |
|
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
Line 206 sub obsolete_unpub {
|
Line 205 sub obsolete_unpub {
|
# see if directory is empty |
# see if directory is empty |
# ignores any .meta, .save, .bak, and .log files created for a previously |
# ignores any .meta, .save, .bak, and .log files created for a previously |
# published file, which has since been marked obsolete and deleted. |
# published file, which has since been marked obsolete and deleted. |
|
# ignores a .DS_Store file put there when viewing directory via webDAV on MacOS. |
sub empty_directory { |
sub empty_directory { |
my ($dirname,$phase) = @_; |
my ($dirname,$phase) = @_; |
if (opendir DIR, $dirname) { |
if (opendir DIR, $dirname) { |
my @files = grep(!/^\.\.?$/, readdir(DIR)); # ignore . and .. |
my @files = grep(!/^\.\.?$/, readdir(DIR)); # ignore . and .. |
if (@files) { |
if (@files) { |
my @orphans = grep(/\.(meta|save|log|bak)$/,@files); |
my @orphans = grep(/\.(meta|save|log|bak|DS_Store)$/,@files); |
if (scalar(@files) - scalar(@orphans) > 0) { |
if (scalar(@files) - scalar(@orphans) > 0) { |
return 0; |
return 0; |
} else { |
} else { |
Line 408 sub relativeDest {
|
Line 408 sub relativeDest {
|
while ($newfilename=~m{/\.\./}) { |
while ($newfilename=~m{/\.\./}) { |
$newfilename=~ s{/[^/]+/\.\./}{/}g; #remove dir/.. |
$newfilename=~ s{/[^/]+/\.\./}{/}g; #remove dir/.. |
} |
} |
my ($authorname,$authordom)=&Apache::loncacc::constructaccess($newfilename); |
my ($authorname,$authordom)=&Apache::lonnet::constructaccess($newfilename); |
unless (($authorname) && ($authordom)) { |
unless (($authorname) && ($authordom)) { |
my $otherdir = &display($newfilename); |
my $otherdir = &display($newfilename); |
$error = &mt('Access denied to [_1]',$otherdir); |
$error = &mt('Access denied to [_1]',$otherdir); |
Line 1441 sub handler {
|
Line 1441 sub handler {
|
|
|
# ----------------------------------------------------------- Start page output |
# ----------------------------------------------------------- Start page output |
|
|
my ($uname,$udom) = &Apache::loncacc::constructaccess($fn); |
my ($uname,$udom) = &Apache::lonnet::constructaccess($fn); |
&Debug($r, |
&Debug($r, |
"loncfile::handler constructaccess uname = $uname domain = $udom"); |
"loncfile::handler constructaccess uname = $uname domain = $udom"); |
if (($uname eq '') || ($udom eq '')) { |
if (($uname eq '') || ($udom eq '')) { |
Line 1480 function writeDone() {
|
Line 1480 function writeDone() {
|
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::add_breadcrumb({ |
&Apache::lonhtmlcommon::add_breadcrumb({ |
'text' => 'Construction Space', |
'text' => 'Construction Space', |
'href' => &Apache::loncommon::authorspace(), |
'href' => &Apache::loncommon::authorspace($fn), |
}); |
}); |
&Apache::lonhtmlcommon::add_breadcrumb({ |
&Apache::lonhtmlcommon::add_breadcrumb({ |
'text' => 'File Operation', |
'text' => 'File Operation', |