[LON-CAPA-cvs] cvs: rat / lonpageflip.pm lonuserstate.pm loncom/interface lontest.pm loncom/lonnet/perl lonnet.pm

www lon-capa-cvs@mail.lon-capa.org
Sat, 01 Mar 2003 15:13:59 -0000


www		Sat Mar  1 10:13:59 2003 EDT

  Modified files:              
    /loncom/interface	lontest.pm 
    /loncom/lonnet/perl	lonnet.pm 
    /rat	lonpageflip.pm lonuserstate.pm 
  Log:
  * Start using library routines in lonuserstate and lonpageflip (ancient code)
  * Have lontest show symbhash
  * Have is_on_map filter for wrapper
  
  
Index: loncom/interface/lontest.pm
diff -u loncom/interface/lontest.pm:1.9 loncom/interface/lontest.pm:1.10
--- loncom/interface/lontest.pm:1.9	Mon Dec  9 17:41:50 2002
+++ loncom/interface/lontest.pm	Sat Mar  1 10:13:58 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # A debugging harness.
 #
-# $Id: lontest.pm,v 1.9 2002/12/09 22:41:50 albertel Exp $
+# $Id: lontest.pm,v 1.10 2003/03/01 15:13:58 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -94,28 +94,42 @@
    if ($ENV{'request.course.id'}) {
 
      my %parmhash;
+     my %symbhash;
      my %hash;
 
      my $fn=$ENV{'request.course.fn'};
 
-     if ((tie(%hash,'GDBM_File',"$fn.db",&GDBM_READER(),0640)) &&
-		(tie(%parmhash,'GDBM_File',
-		     $ENV{'request.course.fn'}.'_parms.db',
-		     &GDBM_READER(),0640))) {
-     $r->print('<h2>Big Hash</h2>');
-         foreach (sort keys %hash) {
-	     $r->print("\n<br>".$_.': '.$hash{$_});
-         }
-     $r->print('<h2>Parm Hash</h2>');
-         foreach (sort keys %parmhash) {
-	     $r->print("\n<br>".$_.': '.$parmhash{$_});
+         if (tie(%hash,'GDBM_File',"$fn.db",&GDBM_READER(),0640)) {
+             $r->print('<h2>Big Hash</h2>');
+             foreach (sort keys %hash) {
+	         $r->print("\n<br>".$_.': '.$hash{$_});
+             }
+             untie %hash;
+         } else {
+             $r->print('<h2>Count not tie big hash</h2>');
          }
-         untie %hash;
-         untie %parmhash;
-     }
-
-
+         if (tie(%parmhash,'GDBM_File',
+		     $ENV{'request.course.fn'}.'_parms.db',
+		     &GDBM_READER(),0640)) {
+             $r->print('<h2>Parm Hash</h2>');
+             foreach (sort keys %parmhash) {
+	        $r->print("\n<br>".$_.': '.$parmhash{$_});
+             }
+             untie %parmhash;
+         } else {
+            $r->print('<h2>Could not tie parmhash</h2>');
+	 }
+         if (tie(%symbhash,'GDBM_File',"$fn\_symb.db",&GDBM_READER(),0640)) {
+            $r->print('<h2>Symb Hash</h2>');
+            foreach (sort keys %symbhash) {
+	       $r->print("\n<br>".$_.': '.$symbhash{$_});
+            }
+            untie %symbhash;
+	 } else {
+            $r->print('<h2>Could not tie symbhash</h2>');
+	 }
  }
+
  
 # ------------------------------------------------------------------- End Debug
      $r->print('</body></html>');        
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.331 loncom/lonnet/perl/lonnet.pm:1.332
--- loncom/lonnet/perl/lonnet.pm:1.331	Thu Feb 20 17:04:18 2003
+++ loncom/lonnet/perl/lonnet.pm	Sat Mar  1 10:13:58 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.331 2003/02/20 22:04:18 www Exp $
+# $Id: lonnet.pm,v 1.332 2003/03/01 15:13:58 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2169,6 +2169,7 @@
     my $filename=$uriparts[$#uriparts];
     my $pathname=$uri;
     $pathname=~s|/\Q$filename\E$||;
+    $pathname=~s/^adm\/wrapper\///;    
     #Trying to find the conditional for the file
     my $match=($ENV{'acc.res.'.$ENV{'request.course.id'}.'.'.$pathname}=~
 	       /\&\Q$filename\E\:([\d\|]+)\&/);
Index: rat/lonpageflip.pm
diff -u rat/lonpageflip.pm:1.34 rat/lonpageflip.pm:1.35
--- rat/lonpageflip.pm:1.34	Tue Jan 14 13:47:50 2003
+++ rat/lonpageflip.pm	Sat Mar  1 10:13:59 2003
@@ -2,7 +2,7 @@
 #
 # Page flip handler
 #
-# $Id: lonpageflip.pm,v 1.34 2003/01/14 18:47:50 www Exp $
+# $Id: lonpageflip.pm,v 1.35 2003/03/01 15:13:59 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -211,7 +211,10 @@
       }
       $currenturl=~s/^http\:\/\///;
       $currenturl=~s/^[^\/]+//;
-      unless ($currenturl=~/^\/(res|adm\/wrapper|public|adm\/coursedocs)\//) {
+#
+# Is the current URL on the map? If not, start with last known URL
+#
+      unless (&Apache::lonnet::is_on_map($currenturl)) {
 	 my $last;
          if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db',
                     &GDBM_READER(),0640)) {
Index: rat/lonuserstate.pm
diff -u rat/lonuserstate.pm:1.53 rat/lonuserstate.pm:1.54
--- rat/lonuserstate.pm:1.53	Fri Feb 28 13:14:44 2003
+++ rat/lonuserstate.pm	Sat Mar  1 10:13:59 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construct and maintain state and binary representation of course for user
 #
-# $Id: lonuserstate.pm,v 1.53 2003/02/28 18:14:44 www Exp $
+# $Id: lonuserstate.pm,v 1.54 2003/03/01 15:13:59 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -381,7 +381,7 @@
             my $urifile=$uriparts[$#uriparts];
             $#uriparts--;
             my $uripath=join('/',@uriparts);
-            $uripath=~s/^\/res\///;
+            $uripath=&Apache::lonnet::declutter($uripath);
            if ($uripath) {
             my $uricond='0';
             if (defined($hash{'conditions_'.$resid})) {