[LON-CAPA-cvs] cvs: loncom /interface londocs.pm

raeburn raeburn at source.lon-capa.org
Tue Nov 22 20:28:51 EST 2016


raeburn		Wed Nov 23 01:28:51 2016 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  - Both hiddenresource and encryturl parameters set in map will apply to
    links in folder listing when a custom role has access to the Course Editor, 
    but adv priv is not set at system level for the role.
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.611 loncom/interface/londocs.pm:1.612
--- loncom/interface/londocs.pm:1.611	Tue Nov 22 00:43:12 2016
+++ loncom/interface/londocs.pm	Wed Nov 23 01:28:50 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.611 2016/11/22 00:43:12 raeburn Exp $
+# $Id: londocs.pm,v 1.612 2016/11/23 01:28:50 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3287,7 +3287,7 @@
         $output .= &entryline($idx,$name,$url,$folder,$allowed,$res,
                               $coursenum,$coursedom,$crstype,
                               $pathitem,$supplementalflag,$container,
-                              \%filters,\%curr_groups,$ltitoolsref,$canedit);
+                              \%filters,\%curr_groups,$ltitoolsref,$canedit,$isencrypted);
         $idx++;
         $shown++;
     }
@@ -3662,7 +3662,7 @@
 sub entryline {
     my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$coursedom,
         $crstype,$pathitem,$supplementalflag,$container,$filtersref,$currgroups,
-        $ltitoolsref,$canedit)=@_;
+        $ltitoolsref,$canedit,$isencrypted)=@_;
     my ($foldertitle,$renametitle,$oldtitle);
     if (&is_supplemental_title($title)) {
 	($title,$foldertitle,$renametitle) = &Apache::loncommon::parse_supplemental_title($title);
@@ -3944,6 +3944,16 @@
                     }
                 }
                 $url.=(($url=~/\?/)?'&':'?').'symb='.&HTML::Entities::encode($shownsymb,'"<>&');
+            } elsif ((!$env{'request.role.adv'}) &&
+                     (((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i) ||
+                      $isencrypted)) {
+                my $shownsymb = &Apache::lonenc::encrypted($symb);
+                my $shownurl = &Apache::lonenc::encrypted($url);
+                if (&Apache::lonnet::symbverify($shownsymb,$shownurl)) {
+                    $url = $shownurl.(($shownurl=~/\?/)?'&':'?').'symb='.&HTML::Entities::encode($shownsymb,'"<>&');
+                } else {
+                    $url='';
+                }
             } else {
                 $url='';
             }
@@ -3977,7 +3987,12 @@
                                                .':'.((&LONCAPA::map::getparameter($orderidx,
                                               'parameter_randomorder'))[0]=~/^yes$/i)
                                                .':'.$ispage;
-	    $url.='folderpath='.&escape($folderpath);
+            if ($env{'request.role.adv'} ||
+                (&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]!~/^yes$/i) {
+                $url.='folderpath='.&escape($folderpath);
+            } else {
+                $url = '';
+            }
             my $rpicknum = (&LONCAPA::map::getparameter($orderidx,
                                                         'parameter_randompick'))[0];
             my $rpckchk;




More information about the LON-CAPA-cvs mailing list