]> git.p6c8.net - devedit.git/blobdiff - modules/Command.pm
Removed some spaces
[devedit.git] / modules / Command.pm
index e8d8520eacbbca7ec000e8e3f5f78212abc2e508..e5be1619203728fb822a59cf4b5a86a284b820f2 100644 (file)
@@ -6,7 +6,7 @@ package Command;
 # Execute Dev-Editor's commands
 #
 # Author:        Patrick Canterino <patrick@patshaping.de>
-# Last modified: 2005-04-23
+# Last modified: 2005-05-29
 #
 
 use strict;
@@ -31,17 +31,17 @@ use Template;
 my $script = encode_html($ENV{'SCRIPT_NAME'});
 my $users  = eval('getpwuid(0)') && eval('getgrgid(0)');
 
-my %dispatch = ('show'       => \&exec_show,
-                'beginedit'  => \&exec_beginedit,
-                'endedit'    => \&exec_endedit,
-                'mkdir'      => \&exec_mkdir,
-                'mkfile'     => \&exec_mkfile,
-                'upload'     => \&exec_upload,
-                'copy'       => \&exec_copy,
-                'rename'     => \&exec_rename,
-                'remove'     => \&exec_remove,
-                'chprop'     => \&exec_chprop,
-                'about'      => \&exec_about
+my %dispatch = ('show'      => \&exec_show,
+                'beginedit' => \&exec_beginedit,
+                'endedit'   => \&exec_endedit,
+                'mkdir'     => \&exec_mkdir,
+                'mkfile'    => \&exec_mkfile,
+                'upload'    => \&exec_upload,
+                'copy'      => \&exec_copy,
+                'rename'    => \&exec_rename,
+                'remove'    => \&exec_remove,
+                'chprop'    => \&exec_chprop,
+                'about'     => \&exec_about
                );
 
 ### Export ###
@@ -101,7 +101,7 @@ sub exec_show($$)
   return error($config->{'errors'}->{'no_dir_access'},$upper_path->{'normal'}) unless(-r $physical && -x $physical);
 
   my $direntries = dir_read($physical);
-  return error($config->{'errors'}->{'dir_read_fail'},$upper_path->{'normal'},{DIR => encode_html($virtual)}) unless($direntries);
+  return error($config->{'errors'}->{'dir_read_failed'},$upper_path->{'normal'},{DIR => encode_html($virtual)}) unless($direntries);
 
   my $files = $direntries->{'files'};
   my $dirs  = $direntries->{'dirs'};
@@ -178,10 +178,9 @@ sub exec_show($$)
    $ftpl->fillin('URL',equal_url(encode_html($config->{'httproot'}),$virt_path->{'html'}));
 
    $ftpl->parse_if_block('link',-l $phys_path);
-   $ftpl->parse_if_block('no_link',not -l $phys_path);
-   $ftpl->parse_if_block('not_readable',not -r $phys_path);
+   $ftpl->parse_if_block('readable',-r $phys_path);
+   $ftpl->parse_if_block('writeable',-w $phys_path);
    $ftpl->parse_if_block('binary',-B $phys_path);
-   $ftpl->parse_if_block('readonly',not -w $phys_path);
 
    $ftpl->parse_if_block('viewable',(-r $phys_path && -T $phys_path && not $too_large) || -l $phys_path);
    $ftpl->parse_if_block('editable',(-r $phys_path && -w $phys_path && -T $phys_path && not $too_large) && not -l $phys_path);
@@ -818,6 +817,7 @@ sub exec_chprop($$)
   {
    # Change the mode
 
+   return error($config->{'errors'}->{'invalid_mode'},$dir) unless($mode =~ /^[0-7]{3,}$/);
    chmod(oct($mode),$physical);
   }
 

patrick-canterino.de