Diff for /loncom/lonnet/perl/lonnet.pm between versions 1.130 and 1.131

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

Removed from v.1.130  
changed lines
  Added in v.1.131


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>