--- loncom/publisher/loncfile.pm 2004/08/12 06:50:15 1.59
+++ loncom/publisher/loncfile.pm 2004/08/24 21:21:41 1.62
@@ -9,7 +9,7 @@
# and displays a page showing the results of the action.
#
#
-# $Id: loncfile.pm,v 1.59 2004/08/12 06:50:15 albertel Exp $
+# $Id: loncfile.pm,v 1.62 2004/08/24 21:21:41 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -988,11 +988,16 @@ sub Copy2 {
unless (copy($oldfile, $newfile)) {
$request->print(' '.&mt('copy Error').': '.$!.'');
return 0;
+ } elsif (!chmod(0660, $newfile)) {
+ $request->print(' '.&mt('chmod error').': '.$!.'');
+ return 0;
+ } elsif (-e $oldfile.'.meta' &&
+ !copy($oldfile.'.meta', $newfile.'.meta') &&
+ !chmod(0660, $newfile.'.meta')) {
+ $request->print(' '.&mt('copy metadata error').
+ ': '.$!.'');
+ return 0;
} else {
- unless (chmod(0660, $newfile)) {
- $request->print(' '.&mt('chmod error').': '.$!.'');
- return 0;
- }
return 1;
}
} else {
@@ -1118,7 +1123,8 @@ sub phasetwo {
return ;
}
$dest = $dir."/.";
- } elsif ($ENV{'form.action'} eq 'rename') { # Rename.
+ } elsif ($ENV{'form.action'} eq 'rename' ||
+ $ENV{'form.action'} eq 'move') {
if($ENV{'form.newfilename'}) {
if (!defined($dir)) {
$fn=~m:^(.*)/:;
@@ -1166,6 +1172,7 @@ sub handler {
$r=shift;
+ &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['decompress','action','filename','newfilename']);
&Debug($r, "loncfile.pm - handler entered");
&Debug($r, " filename: ".$ENV{'form.filename'});
@@ -1184,7 +1191,6 @@ sub handler {
} elsif($ENV{'QUERY_STRING'} && $ENV{'form.phase'} ne 'two') {
#Just hijack the script only the first time around to inject the
#correct information for further processing
- &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['decompress']);
$fn=&Apache::lonnet::unescape($ENV{'form.decompress'});
$fn=&URLToPath($fn);
$ENV{'form.action'}="decompress";