Diff for /loncom/metadata_database/parse_activity_log.pl between versions 1.16 and 1.18

version 1.16, 2005/09/19 18:31:57 version 1.18, 2005/09/20 16:50:40
Line 131  if ($log) { Line 131  if ($log) {
     print STDERR "$0: logging to $logfile".$/;      print STDERR "$0: logging to $logfile".$/;
     if (! open(LOGFILE,">$logfile")) {      if (! open(LOGFILE,">$logfile")) {
         warn("Unable to open $logfile for writing.  Run aborted.");          warn("Unable to open $logfile for writing.  Run aborted.");
         &cleanup_and_exit(5);          &clean_up_and_exit(5);
     } else {      } else {
         $logthis = \&log_to_file;          $logthis = \&log_to_file;
     }      }
Line 180  if (! defined($xmlfile)) { Line 180  if (! defined($xmlfile)) {
     open(LOCKFILE,'>'.$lockfilename);      open(LOCKFILE,'>'.$lockfilename);
     if (!flock(LOCKFILE,LOCK_EX|LOCK_NB)) {      if (!flock(LOCKFILE,LOCK_EX|LOCK_NB)) {
         warn("Unable to lock $lockfilename.  Aborting".$/);          warn("Unable to lock $lockfilename.  Aborting".$/);
         &clean_up_and_exit(6);          # don't call clean_up_and_exit another instance is running and
           # we don't want to 'cleanup' there files
           exit 6;
     }      }
   
     if (! -e $newfilename && -e $sourcefilename) {      if (! -e $newfilename && -e $sourcefilename) {
Line 486  sub process_courselog { Line 488  sub process_courselog {
         foreach my $chunk (split(/\&\&\&/,$log)) {          foreach my $chunk (split(/\&\&\&/,$log)) {
             my $warningflag = '';              my $warningflag = '';
     my ($time,$res,$uname,$udom,$action,@values)= split(/:/,$chunk);      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*$/) {              if (! defined($res) || $res =~ /^\s*$/) {
                 $res = '/adm/roles';                  $res = '/adm/roles';
                 $action = 'LOGIN';                  $action = 'LOGIN';

Removed from v.1.16  
changed lines
  Added in v.1.18


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>