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

raeburn raeburn at source.lon-capa.org
Sun Apr 11 14:05:43 EDT 2021


raeburn		Sun Apr 11 18:05:43 2021 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  - Sanity checking
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1355 loncom/interface/loncommon.pm:1.1356
--- loncom/interface/loncommon.pm:1.1355	Tue Mar 30 23:19:23 2021
+++ loncom/interface/loncommon.pm	Sun Apr 11 18:05:43 2021
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1355 2021/03/30 23:19:23 raeburn Exp $
+# $Id: loncommon.pm,v 1.1356 2021/04/11 18:05:43 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -18255,6 +18255,9 @@
 # $context is the calling context -- roles, grades, contents, menu or flip. 
 sub critical_redirect {
     my ($interval,$context) = @_;
+    unless (($env{'user.domain'} ne '') && ($env{'user.name'} ne '')) {
+        return ();
+    }
     if ((time-$env{'user.criticalcheck.time'})>$interval) {
         if (($env{'request.course.id'}) && (($context eq 'flip') || ($context eq 'contents'))) {
             my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
@@ -18276,7 +18279,7 @@
         &Apache::lonnet::appenv({'user.criticalcheck.time'=>time});
         my $redirecturl;
         if ($what[0]) {
-	    if (($what[0] ne 'con_lost') && ($what[0]!~/^error\:/)) {
+	    if (($what[0] ne 'con_lost') && ($what[0] ne 'no_such_host') && ($what[0]!~/^error\:/)) {
 	        $redirecturl='/adm/email?critical=display';
 	        my $url=&Apache::lonnet::absolute_url().$redirecturl;
                 return (1, $url);




More information about the LON-CAPA-cvs mailing list