version 1.10, 2002/05/27 03:18:46
|
version 1.11, 2002/06/07 01:35:48
|
Line 139 sub phaseone {
|
Line 139 sub phaseone {
|
my $main=$2; |
my $main=$2; |
my $suffix=$3; |
my $suffix=$3; |
|
|
my $conspace='/home/'.$uname.'/public_html'.$fn; |
my $conspace; |
|
if ($fn =~ m-^/home/-) { |
|
$conspace=$fn; |
|
} else { |
|
$conspace='/home/'.$uname.'/public_html'.$fn; |
|
} |
|
|
$r->print('<form action=/adm/cfile method=post>'. |
$r->print('<form action=/adm/cfile method=post>'. |
'<input type=hidden name=filename value="/~'.$uname.$fn.'">'. |
'<input type=hidden name=filename value="/~'.$uname.$fn.'">'. |
Line 215 sub phasetwo {
|
Line 220 sub phasetwo {
|
my $dir=$1; |
my $dir=$1; |
my $main=$2; |
my $main=$2; |
my $suffix=$3; |
my $suffix=$3; |
|
$dir =~ s-^/[^/]*/[^/]*/[^/]*--; |
|
|
|
|
&Debug($r, "loncfile::phase2 dir = $dir main = $main suffix = $suffix"); |
&Debug($r, "loncfile::phase2 dir = $dir main = $main suffix = $suffix"); |
Line 228 sub phasetwo {
|
Line 234 sub phasetwo {
|
if ($ENV{'form.action'} eq 'rename') { |
if ($ENV{'form.action'} eq 'rename') { |
if (-e $conspace) { |
if (-e $conspace) { |
if ($ENV{'form.newfilename'}) { |
if ($ENV{'form.newfilename'}) { |
unless (rename('/home/'.$uname.'/public_html'.$fn, |
unless (rename($fn, |
'/home/'.$uname.'/public_html'.$dir.'/'.$ENV{'form.newfilename'})) { |
'/home/'.$uname.'/public_html'.$dir.'/'.$ENV{'form.newfilename'})) { |
$r->print('<font color=red>Error: '.$!.'</font>'); |
$r->print('<font color=red>Error: '.$!.'</font>'); |
} |
} |
Line 239 sub phasetwo {
|
Line 245 sub phasetwo {
|
} |
} |
} elsif ($ENV{'form.action'} eq 'delete') { |
} elsif ($ENV{'form.action'} eq 'delete') { |
if (-e $conspace) { |
if (-e $conspace) { |
unless (unlink('/home/'.$uname.'/public_html'.$fn)) { |
unless (unlink($fn)) { |
$r->print('<font color=red>Error: '.$!.'</font>'); |
$r->print('<font color=red>Error: '.$!.'</font>'); |
} |
} |
} else { |
} else { |
Line 249 sub phasetwo {
|
Line 255 sub phasetwo {
|
} elsif ($ENV{'form.action'} eq 'copy') { |
} elsif ($ENV{'form.action'} eq 'copy') { |
if (-e $conspace) { |
if (-e $conspace) { |
if ($ENV{'form.newfilename'}) { |
if ($ENV{'form.newfilename'}) { |
unless (copy('/home/'.$uname.'/public_html'.$fn, |
unless (copy($fn, |
'/home/'.$uname.'/public_html'.$dir.'/'.$ENV{'form.newfilename'})) { |
'/home/'.$uname.'/public_html'.$dir.'/'.$ENV{'form.newfilename'})) { |
$r->print('<font color=red>Error: '.$!.'</font>'); |
$r->print('<font color=red>Error: '.$!.'</font>'); |
} |
} |