# Execute Dev-Editor's commands
#
# Author: Patrick Canterino <patshaping@gmx.net>
-# Last modified: 2003-10-27
+# Last modified: 2003-10-30
#
use strict;
# Create directory listing
my $direntries = dir_read($physical);
- return error("Reading of directory $virtual failed") unless($direntries);
+ return error("Reading of directory $virtual failed.",upper_path($virtual)) unless($direntries);
my $files = $direntries->{'files'};
my $dirs = $direntries->{'dirs'};
{
# View a file
- return error("You have not enough permissions to view this file.") unless(-r $physical);
+ return error("You have not enough permissions to view this file.",upper_path($virtual)) unless(-r $physical);
# Check on binary files
# We have to do it in this way, or empty files
{
# Binary file
- return error("This editor is not able to view/edit binary files.");
+ return error("This editor is not able to view/edit binary files.",upper_path($virtual));
}
else
{
my $virtual = $data->{'virtual'};
my $uselist = $data->{'uselist'};
- return error("You cannot edit directories.") if(-d $physical);
+ return error("You cannot edit directories.",upper_path($virtual)) if(-d $physical);
return error_in_use($virtual) if($uselist->in_use($virtual));
- return error("You have not enough permissions to edit this file.") unless(-r $physical && -w $physical);
+ return error("You have not enough permissions to edit this file.",upper_path($virtual)) unless(-r $physical && -w $physical);
# Check on binary files
{
# Binary file
- return error("This editor is not able to view/edit binary files.");
+ return error("This editor is not able to view/edit binary files.",upper_path($virtual));
}
else
{
my $content = $data->{'cgi'}->param('filecontent');
return error("You cannot edit directories.") if(-d $physical);
- return error("You have not enough permissions to edit this file.") unless(-r $physical && -w $physical);
+ return error("You have not enough permissions to edit this file.",upper_path($virtual)) unless(-r $physical && -w $physical);
# Normalize newlines
my $physical = $data->{'physical'};
my $virtual = $data->{'virtual'};
- return error("Deleting directories is currently unsupported.") if(-d $physical);
+ return error("Deleting directories is currently unsupported.",upper_path($virtual)) if(-d $physical);
return error_in_use($virtual) if($data->{'uselist'}->in_use($virtual));
unlink($physical) or return error("Could not delete file '".encode_entities($virtual)."'.",upper_path($virtual));