[LON-CAPA-cvs] cvs: loncom /auth lonacc.pm /interface lonmenu.pm /lonnet/perl lonnet.pm

raeburn raeburn@source.lon-capa.org
Tue, 20 Oct 2009 01:57:47 -0000


raeburn		Tue Oct 20 01:57:47 2009 EDT

  Modified files:              
    /loncom/auth	lonacc.pm 
    /loncom/interface	lonmenu.pm 
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - Bug 6101.
   - external resource URLs can include a query string.  
  
  
Index: loncom/auth/lonacc.pm
diff -u loncom/auth/lonacc.pm:1.128 loncom/auth/lonacc.pm:1.129
--- loncom/auth/lonacc.pm:1.128	Fri Sep 25 13:51:44 2009
+++ loncom/auth/lonacc.pm	Tue Oct 20 01:57:38 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Cookie Based Access Handler
 #
-# $Id: lonacc.pm,v 1.128 2009/09/25 13:51:44 droeschl Exp $
+# $Id: lonacc.pm,v 1.129 2009/10/20 01:57:38 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -411,6 +411,22 @@
 	}
 	$env{'request.filename'} = $r->filename;
 	$env{'request.noversionuri'} = &Apache::lonnet::deversion($requrl);
+        if ($requrl =~ m{^/adm/wrapper/ext/}) {
+            my $query = $r->args;
+            if ($query) {
+                my $preserved;
+                foreach my $pair (split(/&/,$query)) {
+                    my ($name, $value) = split(/=/,$pair);
+                    unless (($name eq 'symb') || ($name eq 'wrapperdisplay')) {
+                        $preserved .= $pair.'&';
+                    }
+                }
+                $preserved =~ s/\&$//;
+                if ($preserved) {
+                    $env{'request.external.querystring'} = $preserved;
+                }
+            }
+        }
 # -------------------------------------------------------- Load POST parameters
 
 	&Apache::lonacc::get_posted_cgi($r);
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.292 loncom/interface/lonmenu.pm:1.293
--- loncom/interface/lonmenu.pm:1.292	Sat Oct 17 01:04:56 2009
+++ loncom/interface/lonmenu.pm	Tue Oct 20 01:57:42 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.292 2009/10/17 01:04:56 raeburn Exp $
+# $Id: lonmenu.pm,v 1.293 2009/10/20 01:57:42 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1519,6 +1519,11 @@
             return ''; }
             
     my $currenturl=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0]));
+    if ($currenturl =~ m{^/adm/wrapper/ext/}) {
+        if ($env{'request.external.querystring'}) {
+            $currenturl .= ($currenturl=~/\?/)?'&':'?'.$env{'request.external.querystring'};
+        }
+    }
     $currenturl=&Apache::lonenc::check_encrypt(&unescape($currenturl));
     
     my $currentsymb=&Apache::lonenc::check_encrypt($env{'request.symb'});
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1031 loncom/lonnet/perl/lonnet.pm:1.1032
--- loncom/lonnet/perl/lonnet.pm:1.1031	Mon Oct 19 02:15:33 2009
+++ loncom/lonnet/perl/lonnet.pm	Tue Oct 20 01:57:46 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1031 2009/10/19 02:15:33 raeburn Exp $
+# $Id: lonnet.pm,v 1.1032 2009/10/20 01:57:46 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -8218,6 +8218,9 @@
 
     if (tie(%bighash,'GDBM_File',$env{'request.course.fn'}.'.db',
                             &GDBM_READER(),0640)) {
+        if (($thisurl =~ m{^/adm/wrapper/ext/}) || ($thisurl =~ m{^ext/})) {
+            $thisurl =~ s/\?.+$//;
+        }
         my $ids=$bighash{'ids_'.&clutter($thisurl)};
         unless ($ids) { 
            $ids=$bighash{'ids_/'.$thisurl};
@@ -8226,6 +8229,9 @@
 # ------------------------------------------------------------------- Has ID(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) { 
@@ -9102,7 +9108,9 @@
     $thisfn=~s|^adm/wrapper/||;
     $thisfn=~s|^adm/coursedocs/showdoc/||;
     $thisfn=~s/^res\///;
-    $thisfn=~s/\?.+$//;
+    unless (($thisfn =~ /^ext/) || ($thisfn =~ /\.(page|sequence)___\d+___ext/)) {
+        $thisfn=~s/\?.+$//;
+    }
     return $thisfn;
 }