[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm

musolffc musolffc at source.lon-capa.org
Tue May 20 16:36:17 EDT 2014


musolffc		Tue May 20 20:36:17 2014 EDT

  Modified files:              
    /loncom/auth	lonroles.pm 
  Log:
  Calls critical_redirect() to check for critical messages 
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.303 loncom/auth/lonroles.pm:1.304
--- loncom/auth/lonroles.pm:1.303	Mon May  5 03:24:37 2014
+++ loncom/auth/lonroles.pm	Tue May 20 20:36:16 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.303 2014/05/05 03:24:37 raeburn Exp $
+# $Id: lonroles.pm,v 1.304 2014/05/20 20:36:16 musolffc Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -128,7 +128,7 @@
 use strict;
 use Apache::lonnet;
 use Apache::lonuserstate();
-use Apache::Constants qw(:common);
+use Apache::Constants qw(:common REDIRECT);
 use Apache::File();
 use Apache::lonmenu;
 use Apache::loncommon;
@@ -202,6 +202,17 @@
 
     my $r = shift;
 
+    # Check for critical messages and redirect if present.  
+    print STDERR "crit check\n";
+    my ($redirect,$url) = &Apache::loncommon::critical_redirect(300);
+    print STDERR "(redirect, url) = $redirect, $url\n";
+    if ($redirect) {
+        print STDERR "check passed.  Redirecting to $url\n";
+        &Apache::loncommon::content_type($r,'text/html');
+        $r->header_out(Location => $url);
+        return REDIRECT;
+    }
+
     my $now=time;
     my $then=$env{'user.login.time'};
     my $refresh=$env{'user.refresh.time'};
@@ -247,7 +258,9 @@
     my $envkey;
     my %dcroles = ();
     my $numdc = &check_fordc(\%dcroles,$update,$then);
-    my $loncaparev = $Apache::lonnet::perlvar{'lonVersion'};
+#my $loncaparev = $Apache::lonnet::perlvar{'lonVersion'};
+    my $loncaparev = $r->dir_config('lonVersion');
+    print STDERR "loncaparev set ||$loncaparev||\n";
 
 # ================================================================== Roles Init
     if ($env{'form.selectrole'}) {
@@ -1754,6 +1767,7 @@
     if ($required ne '') {
         my ($reqdmajor,$reqdminor) = ($required =~ /^(\d+)\.(\d+)$/);
         my ($major,$minor) = ($loncaparev =~ /^\'?(\d+)\.(\d+)\.[\w.\-]+\'?$/);
+        print STDERR "version: required ||$required|| loncaparev ||$loncaparev||\n";
         if ($reqdmajor ne '' && $reqdminor ne '') {
             my $otherserver;
             if (($major eq '' && $minor eq '') || 




More information about the LON-CAPA-cvs mailing list