[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonprintout.pm

raeburn raeburn at source.lon-capa.org
Wed Jul 31 16:10:27 EDT 2019


raeburn		Wed Jul 31 20:10:27 2019 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonprintout.pm 
  Log:
  - For 2.11
    Backport 1.666
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.627.2.27 loncom/interface/lonprintout.pm:1.627.2.28
--- loncom/interface/lonprintout.pm:1.627.2.27	Thu Feb 21 20:40:12 2019
+++ loncom/interface/lonprintout.pm	Wed Jul 31 20:10:26 2019
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.627.2.27 2019/02/21 20:40:12 raeburn Exp $
+# $Id: lonprintout.pm,v 1.627.2.28 2019/07/31 20:10:26 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3455,12 +3455,35 @@
 	$URLback=$helper->{'VARS'}->{'filename'};
     } elsif ($helper->{VARS}{'symb'}) {
         my ($map, $id, $url) = &Apache::lonnet::decode_symb($helper->{VARS}{'symb'});
+        my $cdom =$env{'course.'.$env{'request.course.id'}.'.domain'};
+        my $cnum =$env{'course.'.$env{'request.course.id'}.'.num'};
+        my ($anchor,$usehttp);
         $url = &Apache::lonnet::clutter($url);
+        if (($ENV{'SERVER_PORT'} == 443) && ($env{'request.course.id'}) &&
+            (($url =~ m{^\Q/public/$cdom/$cnum/syllabus\E($|\?)}) ||
+             ($url =~ m{^\Q/adm/wrapper/ext/\E(?!https:)}))) {
+            unless (&Apache::lonnet::uses_sts()) {
+                $usehttp = 1;
+            }
+        }
         if ($env{'request.enc'}) {
             $url = &Apache::lonenc::encrypted($url);
         }
         if ($url ne '') {
-            $URLback = $url.(($url =~ /\?/) ? '&':'?').'symb='.$helper->{VARS}{'symb'};
+            my $symb = $helper->{VARS}{'symb'};
+            if ($url =~ m{^\Q/adm/wrapper/ext/\E}) {
+                my $link = $url;
+                ($link,$anchor) = ($url =~ /^([^\#]+)(?:|(\#[^\#]+))$/);
+                if ($anchor) {
+                    ($symb) = ($helper->{VARS}{'symb'} =~ /^([^\#]+)/);
+                }
+                $url = $link;
+            }
+            $URLback = $url;
+            if ($usehttp) {
+                $URLback .= (($URLback =~ /\?/) ? '&':'?').'usehttp=1';
+            }
+            $URLback .= (($URLback =~ /\?/) ? '&':'?').'symb='.&escape($symb.$anchor);
         }
     }
     #




More information about the LON-CAPA-cvs mailing list