[LON-CAPA-cvs] cvs: rat / lonpageflip.pm lonuserstate.pm

www lon-capa-cvs@mail.lon-capa.org
Thu, 10 Oct 2002 19:05:32 -0000


www		Thu Oct 10 15:05:32 2002 EDT

  Modified files:              
    /rat	lonpageflip.pm lonuserstate.pm 
  Log:
  Bug 790
  
  
Index: rat/lonpageflip.pm
diff -u rat/lonpageflip.pm:1.30 rat/lonpageflip.pm:1.31
--- rat/lonpageflip.pm:1.30	Fri Sep  6 22:55:38 2002
+++ rat/lonpageflip.pm	Thu Oct 10 15:05:32 2002
@@ -2,7 +2,7 @@
 #
 # Page flip handler
 #
-# $Id: lonpageflip.pm,v 1.30 2002/09/07 02:55:38 www Exp $
+# $Id: lonpageflip.pm,v 1.31 2002/10/10 19:05:32 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -285,6 +285,20 @@
 # ============================================== Do not return before this line
               if ($redirecturl) {
 # ----------------------------------------------------- There is a URL to go to
+# ------------------------------------------------- Check for critical messages
+		  if ((time-$ENV{'user.criticalcheck.time'})>300) {
+                     my @what=&Apache::lonnet::dump
+                                  ('critical',$ENV{'user.domain'},
+                                              $ENV{'user.name'});
+                     if ($what[0]) {
+	                if (($what[0] ne 'con_lost') && 
+                            ($what[0]!~/^error\:/)) {
+	                   $redirecturl='/adm/email?critical=display';
+                        }
+                     }
+                     &Apache::lonnet::appenv('user.criticalcheck.time'=>time);
+		  }
+
 		  $r->content_type('text/html');
                   $r->header_out(Location => 
                                 'http://'.$ENV{'HTTP_HOST'}.$redirecturl);
Index: rat/lonuserstate.pm
diff -u rat/lonuserstate.pm:1.45 rat/lonuserstate.pm:1.46
--- rat/lonuserstate.pm:1.45	Mon Oct  7 15:00:43 2002
+++ rat/lonuserstate.pm	Thu Oct 10 15:05:32 2002
@@ -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.45 2002/10/07 19:00:43 www Exp $
+# $Id: lonuserstate.pm,v 1.46 2002/10/10 19:05:32 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -507,6 +507,17 @@
                        "Could not tie coursemap $fn for $uri.</font>"); 
    }
    &Apache::lonmsg::author_res_msg($ENV{'request.course.uri'},$errtext);
+# ------------------------------------------------- Check for critical messages
+
+    my @what=&Apache::lonnet::dump('critical',$ENV{'user.domain'},
+                                              $ENV{'user.name'});
+    if ($what[0]) {
+	if (($what[0] ne 'con_lost') && ($what[0]!~/^error\:/)) {
+	    $retfurl='/adm/email?critical=display';
+        }
+    }
+
+
    return ($retfurl,$errtext);
 }