version 1.45, 2003/11/19 15:06:33
|
version 1.46, 2003/12/13 19:54:16
|
Line 110 sub Debug {
|
Line 110 sub Debug {
|
# Put out the indicated message butonly if DEBUG is true. |
# Put out the indicated message butonly if DEBUG is true. |
|
|
if ($DEBUG) { |
if ($DEBUG) { |
$log->debug($message); |
$r->log_reason($message); |
} |
} |
} |
} |
|
|
Line 851 Returns:
|
Line 851 Returns:
|
|
|
sub Delete2 { |
sub Delete2 { |
my ($request, $user, $filename) = @_; |
my ($request, $user, $filename) = @_; |
|
if(opendir DIR, $filename) { |
if(-e $filename) { |
my @files=readdir(DIR); |
unless(unlink($filename)) { |
shift @files; shift @files; # takes off . and .. |
$request->print('<font color="red">Error: '.$!.'</font>'); |
if(@files) { |
|
$request->print('<font color="red"> Error: Directory Non Empty</font>'); |
return 0; |
return 0; |
} |
} |
} else { |
else { |
$request->print('<p> No such file. </p></form'); |
if(-e $filename) { |
return 0; |
unless(rmdir($filename)) { |
|
$request->print('<font color="red">Error: '.$!.'</font>'); |
|
return 0; |
|
} |
|
} |
|
else { |
|
$request->print('<p> No such file. </p></form'); |
|
return 0; |
|
} |
|
|
|
} |
|
|
|
} |
|
else { |
|
if(-e $filename) { |
|
unless(unlink($filename)) { |
|
$request->print('<font color="red">Error: '.$!.'</font>'); |
|
return 0; |
|
} |
|
} |
|
else { |
|
$request->print('<p> No such file. </p></form'); |
|
return 0; |
} |
} |
|
} |
return 1; |
return 1; |
} |
} |
|
|
Line 999 sub phasetwo {
|
Line 1023 sub phasetwo {
|
my $dir; # Directory path |
my $dir; # Directory path |
my $main; # Filename. |
my $main; # Filename. |
my $suffix; # Extension. |
my $suffix; # Extension. |
|
if ($fn=~m:(.*)/([^/]+):) { |
if ($fn=~m:(.*)/([^/]+)\.(\w+)$:) { |
|
$dir=$1; # Directory path |
$dir=$1; # Directory path |
$main=$2; # Filename. |
$main=$2; # Filename. |
$suffix=$3; # Extension. |
} |
} |
if($main=~m:\.(\w+)$:){ # Fixes problems with filenames with no extensions |
|
$main=$`; |
|
$suffix=$1; |
|
} |
my $dest; # On success this is where we'll go. |
my $dest; # On success this is where we'll go. |
|
|
&Debug($r, |
&Debug($r, |