version 1.28, 2003/03/08 01:41:53
|
version 1.32, 2003/06/19 21:04:37
|
Line 387 sub checksuffix {
|
Line 387 sub checksuffix {
|
} |
} |
return $result; |
return $result; |
} |
} |
|
|
|
sub cleanDest { |
|
my ($request,$dest)=@_; |
|
#remove bad characters |
|
if ($dest=~/[\#\?&]/) { |
|
$request->print("<p><font color=\"red\">Invalid characters in requested name have been removed.</font></p>"); |
|
$dest=~s/[\#\?&]//g; |
|
} |
|
return $dest; |
|
} |
|
|
=pod |
=pod |
|
|
=item CloseForm1($request, $user, $file) |
=item CloseForm1($request, $user, $file) |
Line 412 sub CloseForm1 {
|
Line 423 sub CloseForm1 {
|
&Debug($request, "Cancel url is: ".$cancelurl); |
&Debug($request, "Cancel url is: ".$cancelurl); |
$request->print('<p><input type="submit" value="Continue" /></p></form>'); |
$request->print('<p><input type="submit" value="Continue" /></p></form>'); |
$request->print('<form action="'.$cancelurl. |
$request->print('<form action="'.$cancelurl. |
'" method="GET"><p><input type="submit" value="Cancel" /></p></form>'); |
'" method="POST"><p><input type="submit" value="Cancel" /></p></form>'); |
|
|
} |
} |
|
|
Line 494 sub Rename1 {
|
Line 505 sub Rename1 {
|
if(-e $conspace) { |
if(-e $conspace) { |
if($ENV{'form.newfilename'}) { |
if($ENV{'form.newfilename'}) { |
my $newfilename = $ENV{'form.newfilename'}; |
my $newfilename = $ENV{'form.newfilename'}; |
if ($newfilename =~ m|^[^\.]+$|) { |
if ($newfilename =~ m|/[^\.]+$|) { |
#no extension add on orignal extension |
#no extension add on orignal extension |
if ($filename =~ m|/[^\.]*\.([^\.]+)$|) { |
if ($filename =~ m|/[^\.]*\.([^\.]+)$|) { |
$newfilename.='.'.$1; |
$newfilename.='.'.$1; |
Line 792 sub NewFile1 {
|
Line 803 sub NewFile1 {
|
&Debug($request, "Dest url is: ".$dest); |
&Debug($request, "Dest url is: ".$dest); |
$request->print('</form>'); |
$request->print('</form>'); |
$request->print('<form action="'.$dest. |
$request->print('<form action="'.$dest. |
'" method="GET"><p><input type="submit" value="Continue" /></p></form>'); |
'" method="POST"><p><input type="submit" value="Continue" /></p></form>'); |
$request->print('<form action="'.$cancelurl. |
$request->print('<form action="'.$cancelurl. |
'" method="GET"><p><input type="submit" value="Cancel" /></p></form>'); |
'" method="POST"><p><input type="submit" value="Cancel" /></p></form>'); |
} |
} |
} |
} |
|
|
Line 836 sub phaseone {
|
Line 847 sub phaseone {
|
|
|
# my $conspace=ConstructionPathFromRelative($uname, $fn); |
# my $conspace=ConstructionPathFromRelative($uname, $fn); |
|
|
|
$ENV{'form.newfilename'}=&cleanDest($r,$ENV{'form.newfilename'}); |
|
|
$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.'" />'. |
'<input type="hidden" name="phase" value="two" />'. |
'<input type="hidden" name="phase" value="two" />'. |
Line 865 sub phaseone {
|
Line 877 sub phaseone {
|
$ENV{'form.action'} eq 'newhtmlfile' || |
$ENV{'form.action'} eq 'newhtmlfile' || |
$ENV{'form.action'} eq 'newproblemfile' || |
$ENV{'form.action'} eq 'newproblemfile' || |
$ENV{'form.action'} eq 'newpagefile' || |
$ENV{'form.action'} eq 'newpagefile' || |
$ENV{'form.action'} eq 'newsequencefile') { |
$ENV{'form.action'} eq 'newsequencefile' || |
|
$ENV{'form.action'} eq 'Select Action') { |
if($ENV{'form.newfilename'}) { |
if($ENV{'form.newfilename'}) { |
my $newfilename = $ENV{'form.newfilename'}; |
my $newfilename = $ENV{'form.newfilename'}; |
if (!defined($dir)) { |
if (!defined($dir)) { |
Line 1295 sub handler {
|
Line 1308 sub handler {
|
$ENV{'form.action'} eq 'newhtmlfile' || |
$ENV{'form.action'} eq 'newhtmlfile' || |
$ENV{'form.action'} eq 'newproblemfile' || |
$ENV{'form.action'} eq 'newproblemfile' || |
$ENV{'form.action'} eq 'newpagefile' || |
$ENV{'form.action'} eq 'newpagefile' || |
$ENV{'form.action'} eq 'newsequencefile' ) { |
$ENV{'form.action'} eq 'newsequencefile' || |
|
$ENV{'form.action'} eq 'Select Action' ) { |
$r->print('<h3>New Resource</h3>'); |
$r->print('<h3>New Resource</h3>'); |
} else { |
} else { |
$r->print('<p>Unknown Action</p></body></html>'); |
$r->print('<p>Unknown Action '.$ENV{'form.action'}.' </p></body></html>'); |
return OK; |
return OK; |
} |
} |
if ($ENV{'form.phase'} eq 'two') { |
if ($ENV{'form.phase'} eq 'two') { |