version 1.62, 2004/08/24 21:21:41
|
version 1.65, 2005/03/10 03:50:49
|
Line 289 sub checksuffix {
|
Line 289 sub checksuffix {
|
} |
} |
|
|
sub cleanDest { |
sub cleanDest { |
my ($request,$dest,$subdir)=@_; |
my ($request,$dest,$subdir,$fn,$uname)=@_; |
#remove bad characters |
#remove bad characters |
my $foundbad=0; |
my $foundbad=0; |
if ($subdir && $dest =~/\./) { |
if ($subdir && $dest =~/\./) { |
Line 300 sub cleanDest {
|
Line 300 sub cleanDest {
|
$foundbad=1; |
$foundbad=1; |
$dest=~s/[\#\?&%\"]//g; |
$dest=~s/[\#\?&%\"]//g; |
} |
} |
|
if ($dest=~m|/|) { |
|
my ($newpath)=($dest=~m|(.*)/|); |
|
$newpath=&relativeDest($fn,$newpath,$uname); |
|
if (! -d "$newpath") { |
|
$request->print("<p><font color=\"red\">".&mt('You have requested to create file in directory [_1] which doesn\'t exist. The requested directory path has been removed from the requested file name.','"<tt>'.$newpath.'</tt>"')."</font></p>"); |
|
$dest=~s|.*/||; |
|
} |
|
} |
if ($foundbad) { |
if ($foundbad) { |
$request->print("<p><font color=\"red\">".&mt('Invalid characters in requested name have been removed.')."</font></p>"); |
$request->print("<p><font color=\"red\">".&mt('Invalid characters in requested name have been removed.')."</font></p>"); |
} |
} |
Line 760 sub phaseone {
|
Line 768 sub phaseone {
|
|
|
my $doingdir=0; |
my $doingdir=0; |
if ($ENV{'form.action'} eq 'newdir') { $doingdir=1; } |
if ($ENV{'form.action'} eq 'newdir') { $doingdir=1; } |
my $newfilename=&cleanDest($r,$ENV{'form.newfilename'},$doingdir); |
my $newfilename=&cleanDest($r,$ENV{'form.newfilename'},$doingdir,$fn,$uname); |
$newfilename=&relativeDest($fn,$newfilename,$uname); |
$newfilename=&relativeDest($fn,$newfilename,$uname); |
$r->print('<form action="/adm/cfile" method="post">'. |
$r->print('<form action="/adm/cfile" method="post">'. |
'<input type="hidden" name="qualifiedfilename" value="'.$fn.'" />'. |
'<input type="hidden" name="qualifiedfilename" value="'.$fn.'" />'. |
Line 794 sub phaseone {
|
Line 802 sub phaseone {
|
$ENV{'form.action'} eq 'newsequencefile' || |
$ENV{'form.action'} eq 'newsequencefile' || |
$ENV{'form.action'} eq 'newrightsfile' || |
$ENV{'form.action'} eq 'newrightsfile' || |
$ENV{'form.action'} eq 'newstyfile' || |
$ENV{'form.action'} eq 'newstyfile' || |
|
$ENV{'form.action'} eq 'newlibraryfile' || |
$ENV{'form.action'} eq 'Select Action') { |
$ENV{'form.action'} eq 'Select Action') { |
if ($newfilename) { |
my $empty=&mt('Type Name Here'); |
|
if (($newfilename!~/\/$/) && ($newfilename!~/$empty$/)) { |
&NewFile1($r, $uname, $udom, $fn, $newfilename); |
&NewFile1($r, $uname, $udom, $fn, $newfilename); |
} else { |
} else { |
$r->print('<p>'.&mt('No new filename specified.').'</p></form>'); |
$r->print('<p>'.&mt('No new filename specified.').'</p></form>'); |
Line 1278 function writeDone() {
|
Line 1288 function writeDone() {
|
$ENV{'form.action'} eq 'newsequencefile' || |
$ENV{'form.action'} eq 'newsequencefile' || |
$ENV{'form.action'} eq 'newrightsfile' || |
$ENV{'form.action'} eq 'newrightsfile' || |
$ENV{'form.action'} eq 'newstyfile' || |
$ENV{'form.action'} eq 'newstyfile' || |
|
$ENV{'form.action'} eq 'newlibraryfile' || |
$ENV{'form.action'} eq 'Select Action' ) { |
$ENV{'form.action'} eq 'Select Action' ) { |
$r->print('<h3>'.&mt('New Resource').'</h3>'); |
$r->print('<h3>'.&mt('New Resource').'</h3>'); |
} else { |
} else { |