[LON-CAPA-cvs] cvs: modules /raeburn FIE_usage.pl

raeburn lon-capa-cvs@mail.lon-capa.org
Fri, 26 May 2006 19:00:22 -0000


raeburn		Fri May 26 15:00:22 2006 EDT

  Modified files:              
    /modules/raeburn	FIE_usage.pl 
  Log:
  Will now set username and domain correctly for course owners when writing course owner files.  Also date processing now appropriate for special case leap year settings at century starts. 
  
  
Index: modules/raeburn/FIE_usage.pl
diff -u modules/raeburn/FIE_usage.pl:1.10 modules/raeburn/FIE_usage.pl:1.11
--- modules/raeburn/FIE_usage.pl:1.10	Fri May 26 14:01:35 2006
+++ modules/raeburn/FIE_usage.pl	Fri May 26 15:00:22 2006
@@ -840,21 +840,22 @@
         print SUMM "$output\n";
     }
     close(FILE);
-    my ($uname,$udom);
+    my ($uname,$udom) split/:/,$cc; ;
     my ($usertext,$unametext,$ownernametext,$udomtext,$udomnametext);
     if ($config{'anonymous'} eq 'no') {
         $usertext = $cc;
         $ownernametext = $ownernames{$cc};
         $udomtext = $udom;
         $udomnametext = $udom;
+        $unametext = $uname;
     } else {
         $usertext = $ccname;
         $unametext = $ccname;
+        $udomnametext = $udom;
         $ownernametext = 'hidden';
         $udomtext = 'another';
     }
 
-    my ($uname,$udom) = split/:/,$cc;
     open(OWNER,">fie-data-$unametext-$udomnametext.dat");
     print OWNER "Total number of courses for $ownernametext ($usertext) = $ownercourses{$cc}\n";    
     %{$totals{$cc}} = ();
@@ -1158,9 +1159,12 @@
                 $entries[2] = 29;
             }
             if ($entries[2] == 29) {
-                if ($entries[0]%4) {
-                    $entries[2] = 28;
-                }
+                if ($entries[0]%4 != 0) {
+                    $entries[2] == 28;
+                } elsif ( $entries[0]%100 == 0
+		  && $entries[0]%400 != 0) {
+	            $entries[2] == 28;
+	        }
             }
         }
         $timestamp =  timelocal(0,0,0,$entries[2],$entries[1],$entries[0]);