[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

matthew lon-capa-cvs@mail.lon-capa.org
Wed, 22 Dec 2004 20:34:49 -0000


matthew		Wed Dec 22 15:34:49 2004 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  Store course search terms in activity log.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.582 loncom/lonnet/perl/lonnet.pm:1.583
--- loncom/lonnet/perl/lonnet.pm:1.582	Mon Dec 20 15:51:24 2004
+++ loncom/lonnet/perl/lonnet.pm	Wed Dec 22 15:34:49 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.582 2004/12/20 20:51:24 albertel Exp $
+# $Id: lonnet.pm,v 1.583 2004/12/22 20:34:49 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1588,11 +1588,23 @@
     my $what=$fnsymb.':'.$ENV{'user.name'}.':'.$ENV{'user.domain'};
     if ($fnsymb=~/(problem|exam|quiz|assess|survey|form|page)$/) {
         $what.=':POST';
+        # FIXME: Probably ought to escape things....
 	foreach (keys %ENV) {
             if ($_=~/^form\.(.*)/) {
 		$what.=':'.$1.'='.$ENV{$_};
             }
         }
+    } elsif ($fnsymb =~ m:^/adm/searchcat:) {
+        # FIXME: We should not be depending on a form parameter that someone
+        # editing lonsearchcat.pm might change in the future.
+        if ($ENV{'form.phase'} eq 'course_search') {
+            $what.= ':POST';
+            # FIXME: Probably ought to escape things....
+            foreach my $element ('courseexp','crsfulltext','crsrelated',
+                                 'crsdiscuss') {
+                $what.=':'.$element.'='.$ENV{'form.'.$element};
+            }
+        }
     }
     &courselog($what);
 }