--- loncom/lonnet/perl/lonnet.pm	2001/07/26 18:15:39	1.130
+++ loncom/lonnet/perl/lonnet.pm	2001/07/26 20:26:43	1.131
@@ -41,7 +41,13 @@
 #                      if they aren't given they will be derived from the 
 #                      current enviroment
 # eget(namesp,array) : returns hash with keys from array filled in from namesp
-# get(namesp,array)  : returns hash with keys from array filled in from namesp
+# get(namesp,arrayref,udom,uname)
+#                    : returns hash with keys from array  reference filled
+#                      in from namesp
+#                           if supplied uses udom as the domain and uname
+#                           as the username for the dump (supply a courseid
+#                           for the uname if you want a course database)
+#                           if not supplied it uses %ENV to get the values
 # del(namesp,array)  : deletes keys out of array from namesp
 # put(namesp,hash)   : stores hash in namesp
 # cput(namesp,hash)  : critical put
@@ -49,6 +55,7 @@
 #                           if supplied uses udom as the domain and uname
 #                           as the username for the dump (supply a courseid
 #                           for the uname if you want a course database)
+#                           if not supplied it uses %ENV to get the values
 # ssi(url,hash)      : does a complete request cycle on url to localhost, posts
 #                      hash
 # coursedescription(id) : returns and caches course description for id
@@ -915,21 +922,26 @@ sub rolesinit {
 # --------------------------------------------------------------- get interface
 
 sub get {
-   my ($namespace,@storearr)=@_;
+   my ($namespace,$storearr,$udomain,$uname)=@_;
+   &logthis("from :$udomain:$uname: I got ref :$storearr:");
    my $items='';
    map {
        $items.=escape($_).'&';
-   } @storearr;
+   } @$storearr;
    $items=~s/\&$//;
- my $rep=reply("get:$ENV{'user.domain'}:$ENV{'user.name'}:$namespace:$items",
-                 $ENV{'user.home'});
+   &logthis("and made :$items:");
+   if (!$udomain) { $udomain=$ENV{'user.domain'}; }
+   if (!$uname) { $uname=$ENV{'user.name'}; }
+   my $uhome=&homeserver($uname,$udomain);
+
+   my $rep=reply("get:$udomain:$uname:$namespace:$items",$uhome);
    my @pairs=split(/\&/,$rep);
    my %returnhash=();
    my $i=0;
    map {
       $returnhash{$_}=unescape($pairs[$i]);
       $i++;
-   } @storearr;
+   } @$storearr;
    return %returnhash;
 }
 
@@ -1705,7 +1717,7 @@ sub EXT {
 # ---------------------------------------------------- Any other user namespace
         } else {
             my $item=($rest)?$qualifier.'.'.$rest:$qualifier;
-            my %reply=&get($space,$item);
+            my %reply=&get($space,[$item]);
             return $reply{$item};
         }
     } elsif ($realm eq 'request') {
@@ -1748,7 +1760,7 @@ sub EXT {
 
 # ----------------------------------------------------------- first, check user
          my %resourcedata=get('resourcedata',
-                           ($courselevelr,$courselevelm,$courselevel));
+                           [$courselevelr,$courselevelm,$courselevel]);
          if (($resourcedata{$courselevelr}!~/^error\:/) &&
              ($resourcedata{$courselevelr}!~/^con_lost/)) {