X-Git-Url: https://git.p6c8.net/devedit.git/blobdiff_plain/aeaff6f362f8e376c592469db74f9da3434ecacc..4e40e9a450e412da79b7c3ef4a1eaae268b206a4:/modules/Command.pm?ds=inline diff --git a/modules/Command.pm b/modules/Command.pm index 8e47163..967615d 100644 --- a/modules/Command.pm +++ b/modules/Command.pm @@ -6,7 +6,7 @@ package Command; # Execute Dev-Editor's commands # # Author: Patrick Canterino -# Last modified: 2004-07-28 +# Last modified: 2004-09-05 # use strict; @@ -476,7 +476,7 @@ sub exec_upload($$) my $file_phys = $physical."/".$filename; my $file_virt = $virtual."".$filename; - return error($config->{'errors'}->{'file_exists'},$virtual,{FILE => $file_virt}) if(-e $file_phys); + return error($config->{'errors'}->{'file_exists'},$virtual,{FILE => $file_virt}) if(-e $file_phys && not $cgi->param('overwrite')); my $ascii = $cgi->param('ascii'); my $handle = $cgi->upload('uploaded_file'); @@ -528,7 +528,8 @@ sub exec_copy($$) my $virtual = encode_entities($data->{'virtual'}); my $new_physical = $data->{'new_physical'}; - return error($config->{'errors'}->{'nocopy'}) unless(-r $physical); + return error($config->{'errors'}->{'dircopy'}) if(-d $physical); + return error($config->{'errors'}->{'nocopy'}) unless(-r $physical); if($new_physical) { @@ -542,7 +543,7 @@ sub exec_copy($$) if(-d $new_physical) { - return error($config->{'errors'}->{'dircopy'}); + return error($config->{'errors'}->{'dir_replace'},$dir); } elsif(not $data->{'cgi'}->param('confirmed')) { @@ -617,7 +618,7 @@ sub exec_rename($$) if(-d $new_physical) { - return error($config->{'errors'}->{'dircopy'}); + return error($config->{'errors'}->{'dir_replace'},$dir); } elsif(not $data->{'cgi'}->param('confirmed')) { @@ -772,7 +773,7 @@ sub exec_chprop($$) } else { - my @stat = lstat($physical); + my @stat = stat($physical); my $mode = $stat[2]; my $mode_oct = substr(sprintf("%04o",$mode),-4);