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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 11 Jan 2007 21:09:40 -0000


albertel		Thu Jan 11 16:09:40 2007 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
    /loncom/interface	loncoursedata.pm lonnavmaps.pm 
  Log:
  - dumping of lonnet::stored info has only the symb and the
    parameter escaped so need to push the unescaping off into
    the users of the dumped info (as a result resources with :
    in the symb work in STAT again)
  
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.821 loncom/lonnet/perl/lonnet.pm:1.822
--- loncom/lonnet/perl/lonnet.pm:1.821	Tue Jan  2 21:00:38 2007
+++ loncom/lonnet/perl/lonnet.pm	Thu Jan 11 16:09:10 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.821 2007/01/03 02:00:38 raeburn Exp $
+# $Id: lonnet.pm,v 1.822 2007/01/11 21:09:10 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3070,7 +3070,23 @@
 
 sub dumpstore {
    my ($namespace,$udomain,$uname,$regexp,$range)=@_;
-   return &dump($namespace,$udomain,$uname,$regexp,$range);
+   if (!$udomain) { $udomain=$env{'user.domain'}; }
+   if (!$uname) { $uname=$env{'user.name'}; }
+   my $uhome=&homeserver($uname,$udomain);
+   if ($regexp) {
+       $regexp=&escape($regexp);
+   } else {
+       $regexp='.';
+   }
+   my $rep=&reply("dump:$udomain:$uname:$namespace:$regexp:$range",$uhome);
+   my @pairs=split(/\&/,$rep);
+   my %returnhash=();
+   foreach my $item (@pairs) {
+       my ($key,$value)=split(/=/,$item,2);
+       next if ($key =~ /^error: 2 /);
+       $returnhash{$key}=&thaw_unescape($value);
+   }
+   return %returnhash;
 }
 
 # -------------------------------------------------------------- keys interface
@@ -3104,7 +3120,7 @@
    if ($rep eq "unknown_cmd") { 
        # an old lond will not know currentdump
        # Do a dump and make it look like a currentdump
-       my @tmp = &dump($courseid,$sdom,$sname,'.');
+       my @tmp = &dumpstore($courseid,$sdom,$sname,'.');
        return if ($tmp[0] =~ /^(error:|no_such_host)/);
        my %hash = @tmp;
        @tmp=();
@@ -3129,6 +3145,8 @@
     # we might run in to problems with parameter names =~ /^v\./
     while (my ($key,$value) = each(%hash)) {
         my ($v,$symb,$param) = split(/:/,$key);
+	$symb  = &unescape($symb);
+	$param = &unescape($param);
         next if ($v eq 'version' || $symb eq 'keys');
         next if (exists($returnhash{$symb}) &&
                  exists($returnhash{$symb}->{$param}) &&
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.178 loncom/interface/loncoursedata.pm:1.179
--- loncom/interface/loncoursedata.pm:1.178	Thu Dec 28 16:01:39 2006
+++ loncom/interface/loncoursedata.pm	Thu Jan 11 16:09:39 2007
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursedata.pm,v 1.178 2006/12/28 21:01:39 albertel Exp $
+# $Id: loncoursedata.pm,v 1.179 2007/01/11 21:09:39 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1177,6 +1177,8 @@
     while (my ($key,$value) = each(%studentdata)) {
         next if ($key =~ /^(\d+):(resource$|subnum$|keys:)/);
         my ($transaction,$symb,$parameter) = split(':',$key);
+	$symb = &unescape($symb);
+	$parameter = &unescape($parameter);
         my $symb_id = &get_symb_id($symb);
         if ($parameter eq 'timestamp') {
             # We can deal with 'timestamp' right away
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.396 loncom/interface/lonnavmaps.pm:1.397
--- loncom/interface/lonnavmaps.pm:1.396	Fri Jan  5 01:43:34 2007
+++ loncom/interface/lonnavmaps.pm	Thu Jan 11 16:09:39 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.396 2007/01/05 06:43:34 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.397 2007/01/11 21:09:39 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -38,7 +38,6 @@
 use POSIX qw (floor strftime);
 use Data::Dumper; # for debugging, not always 
 use Time::HiRes qw( gettimeofday tv_interval );
-use lib '/home/httpd/lib/perl/';
 use LONCAPA;
 
 # symbolic constants
@@ -1802,6 +1801,7 @@
 use strict;
 use GDBM_File;
 use Apache::lonnet;
+use LONCAPA;
 
 sub new {
     # magic invocation to create a class instance
@@ -2057,7 +2057,7 @@
 
     my $ressymb = $self->wrap_symb($symb);
     # keys used to store bulletinboard postings use 'unwrapped' symb. 
-    my $discsymb = $self->unwrap_symb($ressymb);
+    my $discsymb = &escape($self->unwrap_symb($ressymb));
     my $version = $self->{DISCUSSION_DATA}{'version:'.$discsymb};
     if (!$version) { return; }