[LON-CAPA-cvs] cvs: loncom /interface lonaboutme.pm lonmenu.pm lonsyllabus.pm

raeburn raeburn at source.lon-capa.org
Thu Oct 27 16:33:31 EDT 2022


raeburn		Thu Oct 27 20:33:31 2022 EDT

  Modified files:              
    /loncom/interface	lonaboutme.pm lonmenu.pm lonsyllabus.pm 
  Log:
  - Sanity checking of value set for $env{'form.folderpath'} before calling
    lonhtmlcommon::docs_breadcrumbs() to create breadcrumbs train when 
    displaying resources in Supplemental Content area. 
  
  
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.161 loncom/interface/lonaboutme.pm:1.162
--- loncom/interface/lonaboutme.pm:1.161	Tue Nov 30 15:55:37 2021
+++ loncom/interface/lonaboutme.pm	Thu Oct 27 20:33:31 2022
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Personal Information Page
 #
-# $Id: lonaboutme.pm,v 1.161 2021/11/30 15:55:37 raeburn Exp $
+# $Id: lonaboutme.pm,v 1.162 2022/10/27 20:33:31 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -84,6 +84,7 @@
 use Apache::lonmsgdisplay();
 use Apache::lontemplate;
 use Apache::longroup;
+use Apache::lonhtmlcommon();
 use HTML::Entities();
 use Image::Magick;
 
@@ -222,7 +223,8 @@
             $args->{'no_nav_bar'} = 1;
         } elsif (!$env{'form.register'}) { #Don't show breadcrumbs twice, when this page is part of course content and you call it
             if (($env{'request.course.id'}) &&
-                 ($env{'form.folderpath'} =~ /^supplemental/)) {
+                ($env{'form.folderpath'} =~ /^supplemental/)) {
+                &Apache::loncommon::validate_folderpath(1,'',$coursenum,$coursedomain);
                 my $crstype = &Apache::loncommon::course_type();
                 my $title = $env{'form.title'};
                 if ($title eq '') {
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.527 loncom/interface/lonmenu.pm:1.528
--- loncom/interface/lonmenu.pm:1.527	Tue Sep 13 12:22:14 2022
+++ loncom/interface/lonmenu.pm	Thu Oct 27 20:33:31 2022
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.527 2022/09/13 12:22:14 raeburn Exp $
+# $Id: lonmenu.pm,v 1.528 2022/10/27 20:33:31 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -935,7 +935,12 @@
                 if ($env{'form.title'}) {
                     $title = $env{'form.title'};
                 }
-                my $trail;
+                my ($trail,$cnum,$cdom);
+                if ($env{'form.folderpath'}) {
+                    $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+                    $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+                    &Apache::loncommon::validate_folderpath(1,'',$cnum,$cdom);
+                }
                 if ($env{'form.folderpath'}) {
                     &prepare_functions($resurl,$forcereg,$group,undef,undef,1,$hostname);
                     ($trail) =
Index: loncom/interface/lonsyllabus.pm
diff -u loncom/interface/lonsyllabus.pm:1.151 loncom/interface/lonsyllabus.pm:1.152
--- loncom/interface/lonsyllabus.pm:1.151	Sun Sep 18 22:33:45 2022
+++ loncom/interface/lonsyllabus.pm	Thu Oct 27 20:33:31 2022
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Syllabus
 #
-# $Id: lonsyllabus.pm,v 1.151 2022/09/18 22:33:45 raeburn Exp $
+# $Id: lonsyllabus.pm,v 1.152 2022/10/27 20:33:31 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -170,6 +170,7 @@
                 } else {
                     my $brcrum;
                     if ($env{'form.folderpath'} =~ /^supplemental/) {
+                        &Apache::loncommon::validate_folderpath(1,'',$cnum,$cdom);
                         my $title = $env{'form.title'};
                         if ($title eq '') {
                             $title = &mt('Syllabus');
@@ -205,6 +206,7 @@
                     $is_pdf = 1;
                 }
                 if ($env{'form.folderpath'} =~ /^supplemental/) {
+                    &Apache::loncommon::validate_folderpath(1,'',$cnum,$cdom);
                     my $title = $env{'form.title'};
                     if ($title eq '') {
                         $title = &mt('Syllabus');
@@ -763,6 +765,7 @@
     my ($cdom,$cnum,$crstype,$args) = @_;
     return unless (ref($args) eq 'HASH');
     if ($env{'form.folderpath'} =~ /^supplemental/) {
+        &Apache::loncommon::validate_folderpath(1,'',$cnum,$cdom);
         my $title = $env{'form.title'};
         if ($title eq '') {
             $title = &mt('Syllabus');




More information about the LON-CAPA-cvs mailing list