version 1.20, 2002/11/27 17:05:50
|
version 1.21, 2003/01/09 22:11:52
|
Line 323 sub exists {
|
Line 323 sub exists {
|
my ($user, $domain, $dir, $file) = @_; |
my ($user, $domain, $dir, $file) = @_; |
|
|
# Create complete paths in publication and construction space. |
# Create complete paths in publication and construction space. |
|
my $relativedir=$dir; |
my $published = &PublicationPath($domain, $user, $dir, $file); |
$relativedir=s|/home/\Q$user\E/public_html||; |
my $construct = &ConstructionPath($user, $dir, $file); |
my $published = &PublicationPath($domain, $user, $relativedir, $file); |
|
my $construct = &ConstructionPath($user, $relativedir, $file); |
|
|
# If the resource exists in either space indicate this fact. |
# If the resource exists in either space indicate this fact. |
# Note that the check for existence in resource space is stricter. |
# Note that the check for existence in resource space is stricter. |
|
|
my $result; |
my $result; |
|
if ( -d $construct ) { |
|
return 'Error: destination for operation is a directory.'; |
|
} |
if ( -e $published) { |
if ( -e $published) { |
$result.='<p><font color=red>Warning: target file exists, and has been published!</font></p>'; |
$result.='<p><font color=red>Warning: target file exists, and has been published!</font></p>'; |
} |
} |
elsif ( -e $construct) { |
elsif ( -e $construct) { |
$result.='<p><font color=red>Warning: target file exists!</font></p>'; |
$result.='<p><font color=red>Warning: target file exists!</font></p>'; |
} |
} |
|
|
return $result; |
return $result; |
|
|
Line 492 sub Rename1 {
|
Line 496 sub Rename1 {
|
if($ENV{'form.newfilename'}) { |
if($ENV{'form.newfilename'}) { |
my $newfilename = $ENV{'form.newfilename'}; |
my $newfilename = $ENV{'form.newfilename'}; |
$request->print(&checksuffix($filename, $newfilename)); |
$request->print(&checksuffix($filename, $newfilename)); |
$request->print(&exists($user, $domain, $dir, $newfilename)); |
my $return=&exists($user, $domain, $dir, $newfilename); |
|
$request->print($return); |
|
if ($return =~/^Error:/) { |
|
$request->print('<br /><a href="'.$cancelurl.'">Cancel</a>'); |
|
return; |
|
} |
my $dest=&SimplifyDir($dir,$newfilename); |
my $dest=&SimplifyDir($dir,$newfilename); |
$request->print('<input type=hidden name=newfilename value="'. |
$request->print('<input type=hidden name=newfilename value="'. |
$newfilename. |
$newfilename. |
Line 590 sub Copy1 {
|
Line 599 sub Copy1 {
|
|
|
if(-e $filename) { |
if(-e $filename) { |
$request->print(&checksuffix($filename,$newfilename)); |
$request->print(&checksuffix($filename,$newfilename)); |
$request->print(&exists($user, $domain, $dir, $newfilename)); |
my $return=&exists($user, $domain, $dir, $newfilename); |
|
$request->print($return); |
|
if ($return =~/^Error:/) { |
|
$request->print('<br /><a href="'.$cancelurl.'">Cancel</a>'); |
|
return; |
|
} |
my $dest=&SimplifyDir($dir,$newfilename); |
my $dest=&SimplifyDir($dir,$newfilename); |
$request->print('<input type = hidden name = newfilename value = "'. |
$request->print('<input type = hidden name = newfilename value = "'. |
$dir.'/'.$newfilename. |
$dir.'/'.$newfilename. |