From: pcanterino <> Date: Sun, 5 Sep 2004 15:25:09 +0000 (+0000) Subject: Ooops...? X-Git-Tag: version_2_1~7 X-Git-Url: https://git.p6c8.net/devedit.git/commitdiff_plain/e03c585e9e4b96bd2934c57cf7c4ec030a13eaed Ooops...? What was that? Something definitely went wrong when I remade the copy and the rename functions. They printed a wrong error message if the destination already existed and if it was a file. Dev-Editor also didn't deny copying a directory. --- diff --git a/errors.dat b/errors.dat index 60088f1..338dbfe 100644 --- a/errors.dat +++ b/errors.dat @@ -16,6 +16,7 @@ create_ar = You aren't allowed to create files and directories above the vi file_exists = A file or directory called '{FILE}' already exists. exist_edited = The target file '{FILE}' already exists and is edited by someone else. in_use = The file '{FILE}' is currently edited by someone else. +dir_replace = You are not allowed to replace a directory. noview = You have not enough permissions to view this file. nocopy = You have not enough permissions to copy this file. dircopy = This editor is not able to copy directories. diff --git a/modules/Command.pm b/modules/Command.pm index 46798ee..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-08-29 +# Last modified: 2004-09-05 # use strict; @@ -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')) {