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

raeburn lon-capa-cvs@mail.lon-capa.org
Tue, 09 Nov 2004 16:18:51 -0000


raeburn		Tue Nov  9 11:18:51 2004 EDT

  Modified files:              
    /loncom/auth	lonroles.pm 
  Log:
  Consolidation + correction to role_status subroutine.
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.102 loncom/auth/lonroles.pm:1.103
--- loncom/auth/lonroles.pm:1.102	Tue Nov  9 10:52:29 2004
+++ loncom/auth/lonroles.pm	Tue Nov  9 11:18:51 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.102 2004/11/09 15:52:29 raeburn Exp $
+# $Id: lonroles.pm,v 1.103 2004/11/09 16:18:51 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -376,18 +376,9 @@
             $tpend=' ';
             $tfont='#000000';
             if ($tstart) {
-		if ($tstart>$then) { 
-                    $tstatus='future';
-                    if ($tstart<$now) { $tstatus='will'; }
-                }
                 $tpstart=&Apache::lonlocal::locallocaltime($tstart);
             }
             if ($tend) {
-                if ($tend<$then) { 
-                    $tstatus='expired'; 
-                } elsif ($tend<$now) { 
-                    $tstatus='will_not'; 
-                }
                 $tpend=&Apache::lonlocal::locallocaltime($tend);
             }
             if ($ENV{'request.role'} eq $trolecode) {
@@ -717,6 +708,10 @@
             ($$tstart,$$tend)=split(/\./,$ENV{$rolekey});
             $$tstatus='is';
             if ($$tstart) {
+                if ($tstart>$then) {
+                    $tstatus='future';
+                    if ($tstart<$now) { $tstatus='will'; }
+                }
                 if ($$tstart>$then) {
                     $$tstatus='future';
                     if ($$tstart<$now) { $$tstatus='will'; }
@@ -725,7 +720,8 @@
             if ($$tend) {
                 if ($$tend<$then) {
                     $$tstatus='expired';
-                    if ($$tend<$now) { $$tstatus='will_not'; }
+                } elsif ($$tend<$now) {
+                     $$tstatus='will_not'; 
                 }
             }
         }