[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 07 Mar 2003 23:37:10 -0000
albertel Fri Mar 7 18:37:10 2003 EDT
Modified files:
/loncom/lonnet/perl lonnet.pm
Log:
- some little things
- BUG#523 EXT now understands CSTR (actually it piggybacks off of
lonhomeworks understanding of CSTR as far as restore, and
passes whichuser info to get)
- you don't need to escape _ in regexp
- convert metadata to use clutter/filelocation
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.334 loncom/lonnet/perl/lonnet.pm:1.335
--- loncom/lonnet/perl/lonnet.pm:1.334 Thu Mar 6 17:41:41 2003
+++ loncom/lonnet/perl/lonnet.pm Fri Mar 7 18:37:09 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.334 2003/03/06 22:41:41 albertel Exp $
+# $Id: lonnet.pm,v 1.335 2003/03/07 23:37:09 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -729,8 +729,8 @@
$author=~s/\/home\/httpd\/html\/res\/([^\/]*)\/([^\/]*).*/$1\/$2/;
my ($udom,$uname)=split(/\//,$author);
my $home=homeserver($uname,$udom);
- if ($home eq 'no_host') {
- return 'not_found';
+ if ($home eq 'no_host') {
+ return 'not_found';
}
my $answer=reply("sub:$fname",$home);
if (($answer eq 'con_lost') || ($answer eq 'rejected')) {
@@ -2855,8 +2855,12 @@
if ($realm eq 'user') {
# --------------------------------------------------------------- user.resource
if ($space eq 'resource') {
- my %restored=&restore(undef,undef,$udom,$uname);
- return $restored{$qualifierrest};
+ if (defined($Apache::lonhomework::parsing_a_problem)) {
+ return $Apache::lonhomework::history{$qualifierrest};
+ } else {
+ my %restored=&restore($symbparm,$courseid,$udom,$uname);
+ return $restored{$qualifierrest};
+ }
# ----------------------------------------------------------------- user.access
} elsif ($space eq 'access') {
# FIXME - not supporting calls for a specific user
@@ -2891,9 +2895,8 @@
return $uname;
# ---------------------------------------------------- Any other user namespace
} else {
- my $item=($rest)?$qualifier.'.'.$rest:$qualifier;
- my %reply=&get($space,[$item]);
- return $reply{$item};
+ my %reply=&get($space,[$qualifierrest],$udom,$uname);
+ return $reply{$qualifierrest};
}
} elsif ($realm eq 'query') {
# ---------------------------------------------- pull stuff out of query string
@@ -3010,7 +3013,7 @@
# ------------------------------------------------------------------ Cascade up
unless ($space eq '0') {
- my ($part,$id)=split(/\_/,$space);
+ my ($part,$id)=split(/_/,$space);
if ($id) {
my $partgeneral=&EXT('resource.'.$part.'.'.$qualifierrest,
$symbparm,$udom,$uname);
@@ -3085,7 +3088,7 @@
}
my %metathesekeys=();
unless ($filename=~/\.meta$/) { $filename.='.meta'; }
- my $metastring=&getfile($perlvar{'lonDocRoot'}.'/res/'.$filename);
+ my $metastring=&getfile(&filelocation('',&clutter($filename)));
my $parser=HTML::LCParser->new(\$metastring);
my $token;
undef %metathesekeys;