--- loncom/lonnet/perl/lonnet.pm 2003/01/10 20:55:44 1.316 +++ loncom/lonnet/perl/lonnet.pm 2003/01/13 21:52:11 1.318 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.316 2003/01/10 20:55:44 www Exp $ +# $Id: lonnet.pm,v 1.318 2003/01/13 21:52:11 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -864,7 +864,7 @@ sub userfileupload { # Replace spaces by underscores $fname=~s/\s+/\_/g; # Replace all other weird characters by nothing - $fname=~s/[^\w\.\-\+]//g; + $fname=~s/[^\w\.\-]//g; # See if there is anything left unless ($fname) { return 'error: no uploaded file'; } chop($ENV{'form.'.$formname}); @@ -1743,6 +1743,25 @@ sub dump { } return %returnhash; } + +# --------------------------------------------------------------- dumpcurrent +sub dumpcurrent { + my ($namespace,$udomain,$uname)=@_; + if (!$udomain) { $udomain = $ENV{'user.domain'}; } + if (!$uname) { $uname = $ENV{'user.name'}; } + my $uhome = &homeserver($uname,$udomain); + my $rep=reply("dumpcurrent:$udomain:$uname:$namespace",$uhome); + &logthis("error = ".$rep) if ($rep =~ /^(error|no_such_host)/); + return if ($rep =~ /^(error:|no_such_host)/); + my @pairs=split(/\&/,$rep); + my %returnhash=(); + foreach (@pairs) { + my ($key,$value)=split(/=/,$_); + my ($symb,$param) = split(/:/,$key); + $returnhash{&unescape($symb)}->{&unescape($param)} = &unescape($value); + } + return %returnhash; +} # --------------------------------------------------------------- put interface