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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 11 Nov 2004 19:55:44 -0000


albertel		Thu Nov 11 14:55:44 2004 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
  Log:
  - if the url we went to was encrypted encrypt the remote's symb/url
  
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.124 loncom/interface/lonmenu.pm:1.125
--- loncom/interface/lonmenu.pm:1.124	Thu Nov 11 13:43:25 2004
+++ loncom/interface/lonmenu.pm	Thu Nov 11 14:55:44 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.124 2004/11/11 18:43:25 matthew Exp $
+# $Id: lonmenu.pm,v 1.125 2004/11/11 19:55:44 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -74,8 +74,8 @@
 
     my $navmaps='';
     my $reloadlink='';
-    my $escurl=&Apache::lonnet::escape($ENV{'request.noversionuri'});
-    my $escsymb=&Apache::lonnet::escape($ENV{'request.symb'});
+    my $escurl=&Apache::lonnet::escape(&check_encrypt($ENV{'request.noversionuri'}));
+    my $escsymb=&Apache::lonnet::escape(&check_encrypt($ENV{'request.symb'}));
     if ($ENV{'browser.interface'} eq 'textual') {
 # Textual display only
 	my %lt=&initlittle();
@@ -473,7 +473,8 @@
 # Registered, graphical output
         } else {
 	    my $requri=(split(/\?/,$ENV{'request.noversionuri'}))[0];
-	    $requri=&Apache::lonnet::unescape($requri);
+	    $requri=&check_encrypt(&Apache::lonnet::unescape($requri));
+	    my $cursymb=&check_encrypt($ENV{'request.symb'});
 	    my $navstatus=&get_nav_status();
 	    $result = (<<ENDREGTHIS);
      
@@ -489,8 +490,8 @@
           $buttons
 	  swmenu.currentURL="$requri";
           swmenu.reloadURL=swmenu.currentURL+window.location.search;
-          swmenu.currentSymb="$ENV{'request.symb'}";
-          swmenu.reloadSymb="$ENV{'request.symb'}";
+          swmenu.currentSymb="$cursymb";
+          swmenu.reloadSymb="$cursymb";
           swmenu.currentStale=0;
 	  $navstatus
           $hwkadd
@@ -977,11 +978,18 @@
 NAVCONTROL
 }
 
+sub check_encrypt {
+    my $str=shift;
+    if ($ENV{'request.enc'}) { return &Apache::lonenc::encrypted($str); }
+    return $str;
+}
+
 sub utilityfunctions {
     unless (($ENV{'browser.interface'} eq 'textual')  ||
         ($ENV{'environment.remote'} eq 'off')) { return ''; }
-    my $currenturl=$ENV{'request.noversionuri'};
-    my $currentsymb=$ENV{'request.symb'};
+    my $currenturl=&check_encrypt($ENV{'request.noversionuri'});
+    
+    my $currentsymb=&check_encrypt($ENV{'request.symb'});
     my $nav_control=&nav_control_js();
 return (<<ENDUTILITY)