# Execute Dev-Editor's commands
#
# Author: Patrick Canterino <patshaping@gmx.net>
-# Last modified: 2004-10-31
+# Last modified: 2004-11-09
#
use strict;
{
# Create directory listing
+ return error($config->{'errors'}->{'no_dir_access'},upper_path($virtual)) unless(-r $physical && -x $physical);
+
my $direntries = dir_read($physical);
- return error($config->{'dir_read_failed'},upper_path($virtual),{DIR => '$virtual'}) unless($direntries);
+ return error($config->{'dir_read_failed'},upper_path($virtual),{DIR => $virtual}) unless($direntries);
my $files = $direntries->{'files'};
my $dirs = $direntries->{'dirs'};
foreach my $dir(@$dirs)
{
- my @stat = stat($physical."/".$dir);
+ my $phys_path = $physical."/".$dir;
my $virt_path = encode_entities($virtual.$dir."/");
+ my @stat = stat($phys_path);
+
my $dtpl = new Template;
$dtpl->read_file($config->{'templates'}->{'dirlist_dir'});
$dtpl->fillin("DATE",strftime($config->{'timeformat'},localtime($stat[9])));
$dtpl->fillin("URL",equal_url($config->{'httproot'},$virt_path));
- $dtpl->parse_if_block("users",$users && -o $physical."/".$dir);
+ $dtpl->parse_if_block("readable",-r $phys_path && -x $phys_path);
+ $dtpl->parse_if_block("users",$users && -o $phys_path);
$dirlist .= $dtpl->get_template;
}