- my $new_physical = $data->{'new_physical'};
- my $new_virtual = $data->{'new_virtual'};
- my $dir = upper_path($new_virtual);
- $new_virtual = encode_entities($new_virtual);
+ my $dir = upper_path($virtual);
+ my $cgi = $data->{'cgi'};
+ my $mode = $cgi->param('mode');
+ my $group = $cgi->param('group');
+
+ if($users)
+ {
+ if(-o $physical)
+ {
+ if($mode || $group)
+ {
+ if($mode)
+ {
+ my $oct_mode = $mode;
+ $oct_mode = "0".$oct_mode if(length($oct_mode) == 3);
+ $oct_mode = oct($oct_mode);
+
+ chmod($oct_mode,$physical);
+ }
+
+ chgrp($group,$physical) if($group);
+
+ return devedit_reload({command => 'show', file => $dir});
+ }
+ else
+ {
+ my @stat = stat($physical);
+
+ my $mode = $stat[2];
+ my $mode_oct = substr(sprintf("%04o",$mode),-4);
+ my $gid = $stat[5];
+ my $group = getgrgid($gid);
+
+ my $tpl = new Template;
+ $tpl->read_file($config->{'templates'}->{'chprop'});
+
+ $tpl->fillin("MODE_OCTAL",$mode_oct);
+ $tpl->fillin("MODE_STRING",mode_string($mode));
+ $tpl->fillin("GID",$gid);
+ $tpl->fillin("GROUP",$group);
+
+ $tpl->fillin("FILE",$virtual);
+ $tpl->fillin("DIR",$dir);
+ $tpl->fillin("URL",equal_url($config->{'httproot'},$virtual));
+ $tpl->fillin("SCRIPT",$script);