--- loncom/lonnet/perl/lonnet.pm 2012/11/29 03:23:52 1.1200 +++ loncom/lonnet/perl/lonnet.pm 2012/11/30 16:46:58 1.1202 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1200 2012/11/29 03:23:52 raeburn Exp $ +# $Id: lonnet.pm,v 1.1202 2012/11/30 16:46:58 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2732,7 +2732,11 @@ sub can_edit_resource { $incourse = 1; if ($file =~/\.(htm|html|css|js|txt)$/) { $cfile = &hreflocation('',$file); - $forceedit = 1; + if ($env{'form.forceedit'}) { + $forceview = 1; + } else { + $forceedit = 1; + } } } elsif ($resurl =~ m{^/public/$cdom/$cnum/syllabus}) { $incourse = 1; @@ -2820,8 +2824,8 @@ sub is_course_upload { my ($file,$cnum,$cdom) = @_; my $uploadpath = &LONCAPA::propath($cdom,$cnum); $uploadpath =~ s{^\/}{}; - if (($file =~ m{^\Q$uploadpath\E/userfiles/docs/}) || - ($file =~ m{^userfiles/\Q$cdom\E/\Q$cnum\E/docs/})) { + if (($file =~ m{^\Q$uploadpath\E/userfiles/(docs|supplemental)/}) || + ($file =~ m{^userfiles/\Q$cdom\E/\Q$cnum\E/(docs|supplemental)/})) { return 1; } return; @@ -10510,11 +10514,11 @@ sub symbverify { } if ($ids) { # ------------------------------------------------------------------- Has ID(s) + if ($thisfn =~ m{^/adm/wrapper/ext/}) { + symb =~ s/\?.+$//; + } foreach my $id (split(/\,/,$ids)) { my ($mapid,$resid)=split(/\./,$id); - if ($thisfn =~ m{^/adm/wrapper/ext/}) { - $symb =~ s/\?.+$//; - } if ( &symbclean(&declutter($bighash{'map_id_'.$mapid}).'___'.$resid.'___'.$thisfn) eq $symb) { @@ -10525,6 +10529,7 @@ sub symbverify { ($bighash{'encrypted_'.$id} eq $env{'request.enc'}) || ($thisurl eq '/adm/navmaps')) { $okay=1; + last; } } }