[LON-CAPA-cvs] cvs: loncom /imspackages imsexport.pm

raeburn raeburn at source.lon-capa.org
Mon Jun 20 12:39:26 EDT 2016


raeburn		Mon Jun 20 16:39:26 2016 EDT

  Modified files:              
    /loncom/imspackages	imsexport.pm 
  Log:
  - Bug 6708. 
  
  
Index: loncom/imspackages/imsexport.pm
diff -u loncom/imspackages/imsexport.pm:1.12 loncom/imspackages/imsexport.pm:1.13
--- loncom/imspackages/imsexport.pm:1.12	Thu Dec 11 00:33:22 2014
+++ loncom/imspackages/imsexport.pm	Mon Jun 20 16:39:26 2016
@@ -1,6 +1,6 @@
 # The LearningOnline Network
 #
-# $Id: imsexport.pm,v 1.12 2014/12/11 00:33:22 raeburn Exp $
+# $Id: imsexport.pm,v 1.13 2016/06/20 16:39:26 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -395,17 +395,17 @@
         }
     } elsif ($symb =~ m-\.(sequence|page)___\d+___uploaded/$cdom/$cnum/-) {
         $$content_file = &replicate_content($cdom,$cnum,$tempexport,$symb,$count,\$message,$href,'uploaded');
-    } elsif ($symb =~ m-\.(sequence|page)___\d+___([^/]+)/([^/]+)-) {
-        my $canedit = 0;
-        if ($2 eq $env{'user.domain'} && $3 eq $env{'user.name'})  {
-            $canedit= 1;
-        }
-# only include problem code where current user is author
+    } elsif ($symb =~ m-\.(?:sequence|page)___\d+___($match_domain/$match_name/.+)$-) {
+        my $url = &Apache::lonnet::clutter($1);
+        $url =~ s{^/res/}{/priv/};
         if (($format eq 'html') || ($format eq 'plaintext')) {
             my $title = $curRes->title;
             $$content_file = &replicate_content($cdom,$cnum,$tempexport,$symb,$count,\$message,$href,$format,$currdirpath,$title,$testbank);
         } elsif ($format eq 'xml') {
-            if ($canedit) {
+# only include problem code where current user is author or co-author,
+# or this is a course "author" resource.
+            my ($ownername,$ownerdom,$ownerhome) = &Apache::lonnet::constructaccess($url);
+            if (($ownername ne '') && ($ownerdom ne '') && ($ownerhome ne '')) {
                 $$content_file = &replicate_content($cdom,$cnum,$tempexport,$symb,$count,\$message,$href,'resource');
             } else {
                 $$content_file = &replicate_content($cdom,$cnum,$tempexport,$symb,$count,\$message,$href,'noedit');




More information about the LON-CAPA-cvs mailing list