--- loncom/lonnet/perl/lonnet.pm 2010/10/27 01:00:44 1.1090 +++ loncom/lonnet/perl/lonnet.pm 2010/11/27 16:55:57 1.1094 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1090 2010/10/27 01:00:44 raeburn Exp $ +# $Id: lonnet.pm,v 1.1094 2010/11/27 16:55:57 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2352,7 +2352,7 @@ sub resizeImage { # --------------- Take an uploaded file and put it into the userfiles directory # input: $formname - the contents of the file are in $env{"form.$formname"} -# the desired filenam is in $env{"form.$formname.filename"} +# the desired filename is in $env{"form.$formname.filename"} # $context - possible values: coursedoc, existingfile, overwrite, # canceloverwrite, or ''. # if 'coursedoc': upload to the current course @@ -2381,7 +2381,6 @@ sub userfileupload { $fname=&clean_filename($fname); # See if there is anything left unless ($fname) { return 'error: no uploaded file'; } - chop($env{'form.'.$formname}); # Files uploaded to help request form, or uploaded to "create course" page are handled differently if ((($formname eq 'screenshot') && ($subdir eq 'helprequests')) || (($formname eq 'coursecreatorxml') && ($subdir eq 'batchupload')) || @@ -2442,7 +2441,7 @@ sub userfileupload { } if ($subdir eq 'scantron') { $fname = 'scantron_orig_'.$fname; - } else { + } else { $fname="$subdir/$fname"; } if ($context eq 'coursedoc') { @@ -7288,7 +7287,7 @@ sub is_locked { my ($file_name, $domain, $user) = @_; my @check; my $is_locked; - push @check, $file_name; + push (@check,$file_name); my %locked = &get('file_permissions',\@check, $env{'user.domain'},$env{'user.name'}); my ($tmp)=keys(%locked); @@ -7305,6 +7304,7 @@ sub is_locked { } else { $is_locked = 'false'; } + return $is_locked; } sub declutter_portfile {