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

raeburn lon-capa-cvs@mail.lon-capa.org
Fri, 26 May 2006 20:06:13 -0000


raeburn		Fri May 26 16:06:13 2006 EDT

  Modified files:              
    /modules/raeburn	FIE_usage.pl 
  Log:
  Fixing file names for anonymized case.
  
  
Index: modules/raeburn/FIE_usage.pl
diff -u modules/raeburn/FIE_usage.pl:1.11 modules/raeburn/FIE_usage.pl:1.12
--- modules/raeburn/FIE_usage.pl:1.11	Fri May 26 15:00:22 2006
+++ modules/raeburn/FIE_usage.pl	Fri May 26 16:06:03 2006
@@ -220,7 +220,7 @@
             }
             if ((($startenroll >= $config{'startopen'}) && ($startenroll)) &&
                  ((($startenroll <= $config{'startclose'}) || !$config{'startclose'}) && ($startenroll))) {
-                my $code = $courseenv{'coursecode'};
+                my $code = $courseenv{'internal.coursecode'};
                 if (!defined($code)) {
                     $code = 'none';
                 } 
@@ -234,7 +234,7 @@
             if (defined($coursehash{$cid})) {
                 my ($cdom,$cnum) = split(/_/,$cid);
                 my %courseenv = &Apache::lonnet::dump('environment',$cdom,$cnum);
-                my $code = $courseenv{'coursecode'};
+                my $code = $courseenv{'internal.coursecode'};
                 if (!defined($code)) {
                     $code = 'none';
                 }
@@ -326,11 +326,11 @@
                 $ownertext = $owner;
                 $ownerdomtext = $ownerdom;
             } else {
-                $ownerdom = 'hidden';
+                $ownerdomtext = $ownerdom;
             }
-            print LOG "$courses{$cid} - Owner is $owner, ownerdom is $ownerdom\n";
+            print LOG "$courses{$cid} - Owner is $ownertext, ownerdom is $ownerdomtext\n";
             push(@{$ownedcourses{$owner.':'.$ownerdom}},$cid);
-            unless (grep/^$owner:$ownerdom/,@allowners) {
+            unless (grep/^\Q$owner\E:\Q$ownerdom\E$/,@allowners) {
                 push @allowners, $owner.':'.$ownerdom;
             }
             unless (defined($ownercourses{$owner.':'.$ownerdom})) {
@@ -840,7 +840,7 @@
         print SUMM "$output\n";
     }
     close(FILE);
-    my ($uname,$udom) split/:/,$cc; ;
+    my ($uname,$udom) = split/:/,$cc;
     my ($usertext,$unametext,$ownernametext,$udomtext,$udomnametext);
     if ($config{'anonymous'} eq 'no') {
         $usertext = $cc;
@@ -851,9 +851,9 @@
     } else {
         $usertext = $ccname;
         $unametext = $ccname;
-        $udomnametext = $udom;
         $ownernametext = 'hidden';
         $udomtext = 'another';
+        $udomnametext = 'somedomain';
     }
 
     open(OWNER,">fie-data-$unametext-$udomnametext.dat");
@@ -861,7 +861,7 @@
     %{$totals{$cc}} = ();
     %{$sizes{$cc}} = ();
     %{$publish{$cc}} = ();
-    if (grep/^$udom/,@domains) {
+    if (grep($udom,@domains)) {
         print OWNER "Last activity ".localtime($lastactivity{$cc})." $unametext uses this server as a homeserver\n";
         if (-e "/home/$uname/public_html") {
 #            &readtree("/home/$uname/public_html",\%totals,\%sizes,\%publish,$cc,$uname,$udom);