[LON-CAPA-cvs] cvs: loncom /interface lonwhatsnew.pm rat lonuserstate.pm

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 14 Jul 2005 21:30:26 -0000


albertel		Thu Jul 14 17:30:26 2005 EDT

  Modified files:              
    /rat	lonuserstate.pm 
    /loncom/interface	lonwhatsnew.pm 
  Log:
  - make lonwhats new faster (BUG#4240)
  
  
Index: rat/lonuserstate.pm
diff -u rat/lonuserstate.pm:1.93 rat/lonuserstate.pm:1.94
--- rat/lonuserstate.pm:1.93	Wed Jun 29 07:57:17 2005
+++ rat/lonuserstate.pm	Thu Jul 14 17:30:24 2005
@@ -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.93 2005/06/29 11:57:17 www Exp $
+# $Id: lonuserstate.pm,v 1.94 2005/07/14 21:30:24 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -128,6 +128,7 @@
 # Successfully got file, parse it
 
         my $parser = HTML::TokeParser->new(\$instr);
+	#$parser->attr_encoded(1);
         my $token;
 
         my $linkpc=0;
@@ -590,6 +591,7 @@
 	}
 # ----------------------------------------------- Close hashes to finally store
 # --------------------------------- Routine must pass this point, no early outs
+	$hash{'first_url'}=$retfurl;
 	unless ((untie(%hash)) && (untie(%parmhash))) {
 	    &Apache::lonnet::logthis("<font color=blue>WARNING: ".
 				     "Could not untie coursemap $fn for $uri.</font>"); 
Index: loncom/interface/lonwhatsnew.pm
diff -u loncom/interface/lonwhatsnew.pm:1.23 loncom/interface/lonwhatsnew.pm:1.24
--- loncom/interface/lonwhatsnew.pm:1.23	Sat Jul  9 22:31:30 2005
+++ loncom/interface/lonwhatsnew.pm	Thu Jul 14 17:30:25 2005
@@ -1,5 +1,5 @@
 #
-# $Id: lonwhatsnew.pm,v 1.23 2005/07/10 02:31:30 albertel Exp $
+# $Id: lonwhatsnew.pm,v 1.24 2005/07/14 21:30:25 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -38,6 +38,7 @@
 use Apache::lonuserstate;
 use Apache::Constants qw(:common :http);
 use Time::Local;
+use GDBM_File;
 
 #----------------------------
 # handler
@@ -190,10 +191,12 @@
         $r->print('<br /><b><center>You are accessing an invalid course.</center></b><br /><br />');
         return;
     }
-
-    my ($furl,$ferr)=
-           &Apache::lonuserstate::readmap($cdom.'/'.$crs);
-    $r->print('<font size="+1"><a href="'.$furl.'">Go to first resource</a></font><a href="/adm/preferences?action=changecourseinit"></font><br />Change your preferences</a> to suppress display of this screen when accessing courses as Course Coordinator in the future.<br /><hr />');
+    if (tie(my %bighash,'GDBM_File',$env{'request.course.fn'}.'.db',
+	    &GDBM_READER(),0640)) {
+	my $furl=$bighash{'first_url'};
+	$r->print('<font size="+1"><a href="'.$furl.'">Go to first resource</a></font><a href="/adm/preferences?action=changecourseinit"></font><br />Change your preferences</a> to suppress display of this screen when accessing courses as Course Coordinator in the future.<br /><hr />');
+	untie(%bighash);
+    }
 
     my $result;