--- loncom/publisher/loncfile.pm 2003/06/19 20:49:13 1.31 +++ loncom/publisher/loncfile.pm 2003/08/01 18:06:33 1.34 @@ -9,7 +9,7 @@ # and displays a page showing the results of the action. # # -# $Id: loncfile.pm,v 1.31 2003/06/19 20:49:13 albertel Exp $ +# $Id: loncfile.pm,v 1.34 2003/08/01 18:06:33 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -92,6 +92,7 @@ use Apache::Constants qw(:common :http : use Apache::loncacc; use Apache::Log (); use Apache::lonnet; +use Apache::loncommon(); my $DEBUG=0; my $r; # Needs to be global for some stuff RF. @@ -387,6 +388,17 @@ sub checksuffix { } return $result; } + +sub cleanDest { + my ($request,$dest)=@_; + #remove bad characters + if ($dest=~/[\#\?&]/) { + $request->print("

Invalid characters in requested name have been removed.

"); + $dest=~s/[\#\?&]//g; + } + return $dest; +} + =pod =item CloseForm1($request, $user, $file) @@ -778,12 +790,6 @@ sub NewFile1 { } } - #remove bad characters - if ($newfilename=~/[\#\?&]/) { - $request->print("

Invalid characters in requested filename have been removed.

"); - $newfilename=~s/[\#\?&]//g; - } - my $fullpath = $dir.'/'.$newfilename; &Debug($request, "Full path is : ".$fullpath); @@ -842,7 +848,8 @@ sub phaseone { # my $conspace=ConstructionPathFromRelative($uname, $fn); - + $ENV{'form.newfilename'}=&cleanDest($r,$ENV{'form.newfilename'}); + $r->print('
'. ''. ''. @@ -872,6 +879,8 @@ sub phaseone { $ENV{'form.action'} eq 'newproblemfile' || $ENV{'form.action'} eq 'newpagefile' || $ENV{'form.action'} eq 'newsequencefile' || + $ENV{'form.action'} eq 'newrightsfile' || + $ENV{'form.action'} eq 'newstyfile' || $ENV{'form.action'} eq 'Select Action') { if($ENV{'form.newfilename'}) { my $newfilename = $ENV{'form.newfilename'}; @@ -1276,8 +1285,7 @@ sub handler { $r->print('LON-CAPA Construction Space'); - $r->print( - ''); + $r->print(&Apache::loncommon::bodytag('File Operation')); $r->print('

Construction Space '.$fn.'

'); @@ -1303,6 +1311,8 @@ sub handler { $ENV{'form.action'} eq 'newproblemfile' || $ENV{'form.action'} eq 'newpagefile' || $ENV{'form.action'} eq 'newsequencefile' || + $ENV{'form.action'} eq 'newrightsfile' || + $ENV{'form.action'} eq 'newstyfile' || $ENV{'form.action'} eq 'Select Action' ) { $r->print('

New Resource

'); } else {