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

raeburn lon-capa-cvs@mail.lon-capa.org
Tue, 09 Nov 2004 20:04:48 -0000


raeburn		Tue Nov  9 15:04:48 2004 EDT

  Modified files:              
    /loncom/auth	lonroles.pm 
  Log:
  Changes made during a house call by the style police
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.104 loncom/auth/lonroles.pm:1.105
--- loncom/auth/lonroles.pm:1.104	Tue Nov  9 13:18:02 2004
+++ loncom/auth/lonroles.pm	Tue Nov  9 15:04:48 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.104 2004/11/09 18:18:02 raeburn Exp $
+# $Id: lonroles.pm,v 1.105 2004/11/09 20:04:48 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -539,8 +539,7 @@
                                     '</font>';
 			}
                     } else {
-                        my %newhash=Apache::lonnet::coursedescription
-                            ($tcourseid);
+                        my %newhash=&Apache::lonnet::coursedescription($tcourseid);
                         if (%newhash) {
 			    $sortkey=$role."\0".$tdom."\0".$newhash{'description'}.
 				"\0".$envkey;
@@ -810,11 +809,9 @@
             $$trolecode=$$role.'.'.$$where;
             ($$tstart,$$tend)=split(/\./,$ENV{$rolekey});
             $$tstatus='is';
-            if ($$tstart) {
-                if ($$tstart>$then) {
-                    $$tstatus='future';
-                    if ($$tstart<$now) { $$tstatus='will'; }
-                }
+            if ($$tstart && $$tstart>$then) {
+		$$tstatus='future';
+		if ($$tstart<$now) { $$tstatus='will'; }
             }
             if ($$tend) {
                 if ($$tend<$then) {
@@ -848,19 +845,11 @@
                 my $dcdom = $1;
                 my $livedc = 1;
                 my ($tstart,$tend)=split(/\./,$ENV{$envkey});
-                if ($tstart) {
-                    if ($tstart>$then) {
-                        $livedc = 0;
-                    }
-                }
-                if ($tend) {
-                    if ($tend<$then) {
-                        $livedc = 0;
-                    }
-                }
+                if ($tstart && $tstart>$then) { $livedc = 0; }
+                if ($tend   && $tend  <$then) { $livedc = 0; }
                 if ($livedc) {
                     $$dcroles{$dcdom} = $envkey;
-                    $numdc ++;
+                    $numdc++;
                 }
             }
         }