[LON-CAPA-cvs] cvs: loncom /metadata_database parse_activity_log.pl

matthew lon-capa-cvs@mail.lon-capa.org
Tue, 20 Sep 2005 16:50:43 -0000


matthew		Tue Sep 20 12:50:43 2005 EDT

  Modified files:              
    /loncom/metadata_database	parse_activity_log.pl 
  Log:
  Deal with uploaded files being stored in the activity.log by skipping them.
  
  
Index: loncom/metadata_database/parse_activity_log.pl
diff -u loncom/metadata_database/parse_activity_log.pl:1.17 loncom/metadata_database/parse_activity_log.pl:1.18
--- loncom/metadata_database/parse_activity_log.pl:1.17	Mon Sep 19 16:30:37 2005
+++ loncom/metadata_database/parse_activity_log.pl	Tue Sep 20 12:50:40 2005
@@ -2,7 +2,7 @@
 #
 # The LearningOnline Network
 #
-# $Id: parse_activity_log.pl,v 1.17 2005/09/19 20:30:37 albertel Exp $
+# $Id: parse_activity_log.pl,v 1.18 2005/09/20 16:50:40 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -488,6 +488,19 @@
         foreach my $chunk (split(/\&\&\&/,$log)) {
             my $warningflag = '';
 	    my ($time,$res,$uname,$udom,$action,@values)= split(/:/,$chunk);
+            # 
+            # Sometimes we get a file pasted into the activity.log from
+            # an upload form.  Here we try to detect it and avoid inserting
+            # it into the database to avoid the quiet death of the database
+            # connection
+            my $i;
+            for ($i=0;$i<$#values;$i++) {
+                if ($values[$i] =~ /^HWVAL/) {
+                    $#values = $i;
+                    last;
+                }
+            }
+            #
             if (! defined($res) || $res =~ /^\s*$/) {
                 $res = '/adm/roles';
                 $action = 'LOGIN';