--- loncom/interface/loncommon.pm 2017/10/15 13:26:55 1.1298 +++ loncom/interface/loncommon.pm 2017/11/12 13:15:25 1.1301 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1298 2017/10/15 13:26:55 raeburn Exp $ +# $Id: loncommon.pm,v 1.1301 2017/11/12 13:15:25 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -85,7 +85,7 @@ use DynaLoader; # for Crypt::DES version use MIME::Lite; use MIME::Types; use File::Copy(); -use File::Path::Tiny(); +use File::Path(); # ---------------------------------------------- Designs use vars qw(%defaultdesign); @@ -8921,7 +8921,11 @@ var LCprogressTxt='---'; function LCupdateProgress(percent,progresstext,id) { LCprogressTxt=progresstext; - \$('#progressbar'+id).progressbar('value',percent); + if (percent === \$('#progressbar'+id).progressbar( "value" )) { + \$('#progressbar'+id).find('.pblabel').text(LCprogressTxt); + } else { + \$('#progressbar'+id).progressbar('value',percent); + } } // ]]> @@ -12660,7 +12664,7 @@ sub process_decompression { if (-f "$dir/$tempdir/$item") { unlink("$dir/$tempdir/$item"); } elsif (-d "$dir/$tempdir/$item") { - &File::Path::Tiny::rm("$dir/$tempdir/$item"); + &File::Path::remove_tree("$dir/$tempdir/$item",{ safe => 1 }); } } } @@ -12670,14 +12674,14 @@ sub process_decompression { if (-f "$dir/$item") { unlink("$dir/$item"); } elsif (-d "$dir/$item") { - &File::Path::Tiny::rm("$dir/$item"); + &File::Path::remove_tree("$dir/$item",{ safe => 1 }); } &File::Copy::move("$dir/$tempdir/$item","$dir/$item"); } } } if (&File::Copy::move("$dir/$tempdir/$file","$dir/$file")) { - &File::Path::Tiny::rm("$dir/$tempdir"); + &File::Path::remove_tree("$dir/$tempdir",{ safe => 1 }); } } } else { @@ -13700,8 +13704,11 @@ sub upfile_store { $env{'form.upfile'}=~s/\n+/\n/gs; $env{'form.upfile'}=~s/\n+$//gs; - my $datatoken=$env{'user.name'}.'_'.$env{'user.domain'}. - '_enroll_'.$env{'request.course.id'}.'_'.time.'_'.$$; + my $datatoken = &valid_datatoken($env{'user.name'}.'_'.$env{'user.domain'}. + '_enroll_'.$env{'request.course.id'}.'_'. + time.'_'.$$); + return if ($datatoken eq ''); + { my $datafile = $r->dir_config('lonDaemons'). '/tmp/'.$datatoken.'.tmp';