[LON-CAPA-cvs] cvs: rat(version_2_11_X) / lonuserstate.pm

raeburn raeburn at source.lon-capa.org
Tue Dec 14 17:52:33 EST 2021


raeburn		Tue Dec 14 22:52:33 2021 EDT

  Modified files:              (Branch: version_2_11_X)
    /rat	lonuserstate.pm 
  Log:
  - For 2.11
    Backport 1.161, 1.162, 1.163
  
  
Index: rat/lonuserstate.pm
diff -u rat/lonuserstate.pm:1.149.2.4 rat/lonuserstate.pm:1.149.2.5
--- rat/lonuserstate.pm:1.149.2.4	Sat May  2 21:28:08 2020
+++ rat/lonuserstate.pm	Tue Dec 14 22:52:33 2021
@@ -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.149.2.4 2020/05/02 21:28:08 raeburn Exp $
+# $Id: lonuserstate.pm,v 1.149.2.5 2021/12/14 22:52:33 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1200,7 +1200,7 @@
 # ---------------------------------------------------- Read map and all submaps
 
 sub readmap {
-    my $short=shift;
+    my ($short,$critmsg_check) = @_;
     $short=~s/^\///;
 
     # TODO:  Hidden dependency on current user:
@@ -1437,14 +1437,18 @@
 
 #  Depends on user must parameterize this as well..or separate as this is:
 #  more part of determining what someone sees on entering a course?
+#  When lonuserstate::readmap() is called from lonroles.pm, i.e.,
+#  after selecting a role in a course, critical_redirect will be called,
+#  unless the course has a blocking event in effect, which suppresses
+#  critical message checking (users without evb priv).
+#
 
-    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';
+    if ($critmsg_check) {
+        my ($redirect,$url) = &Apache::loncommon::critical_redirect();
+        if ($redirect) {
+            $retfurl = $url;
         }
-    }
+    } 
     return ($retfurl,$errtext);
 }
 




More information about the LON-CAPA-cvs mailing list