Diff for /loncom/lonnet/perl/lonnet.pm between versions 1.265 and 1.269

version 1.265, 2002/08/09 18:12:19 version 1.269, 2002/08/17 18:58:28
Line 820  sub flushcourselogs { Line 820  sub flushcourselogs {
         my $entry=$_;          my $entry=$_;
         $entry=~/\_\_\_(\w+)\/(\w+)\/(.*)\_\_\_(\w+)$/;          $entry=~/\_\_\_(\w+)\/(\w+)\/(.*)\_\_\_(\w+)$/;
         my %temphash=($entry => $accesshash{$entry});          my %temphash=($entry => $accesshash{$entry});
         if (&Apache::lonnet::put('resevaldata',\%temphash,$1,$2) eq 'ok') {          if (&Apache::lonnet::put('nohist_resevaldata',\%temphash,$1,$2) eq 'ok') {
     delete $accesshash{$entry};      delete $accesshash{$entry};
         }          }
     }      }
Line 1114  sub str2hashref { Line 1114  sub str2hashref {
           }            }
       } else {        } else {
           $string =~ s/^(.*?)=//;            $string =~ s/^(.*?)=//;
   $key=$1    $key=&unescape($1);
       }        }
       $string =~ s/^=//;        $string =~ s/^=//;
   
Line 3082  sub receipt { Line 3082  sub receipt {
 # ------------------------------------------------------------ Serves up a file  # ------------------------------------------------------------ Serves up a file
 # returns either the contents of the file or a -1  # returns either the contents of the file or a -1
 sub getfile {  sub getfile {
   my $file=shift;   my $file=shift;
    if ($file=~/^\/*uploaded\//) { # user file
       my $ua=new LWP::UserAgent;
       my $request=new HTTP::Request('GET',&tokenwrapper($file));
       my $response=$ua->request($request);
       if ($response->is_success()) {
          return $response->content;
       } else { 
          return -1; 
       }
    } else { # normal file from res space
   &repcopy($file);    &repcopy($file);
   if (! -e $file ) { return -1; };    if (! -e $file ) { return -1; };
   my $fh=Apache::File->new($file);    my $fh=Apache::File->new($file);
   my $a='';    my $a='';
   while (<$fh>) { $a .=$_; }    while (<$fh>) { $a .=$_; }
   return $a    return $a;
    }
 }  }
   
 sub filelocation {  sub filelocation {
Line 3135  sub declutter { Line 3146  sub declutter {
     return $thisfn;      return $thisfn;
 }  }
   
   # ------------------------------------------------------------- Clutter up URLs
   
   sub clutter {
       my $thisfn='/'.&declutter(shift);
       unless ($thisfn=~/^\/(uploaded|adm)\//) { $thisfn='/res'.$thisfn; }
       return $thisfn;
   }
   
 # -------------------------------------------------------- Escape Special Chars  # -------------------------------------------------------- Escape Special Chars
   
 sub escape {  sub escape {

Removed from v.1.265  
changed lines
  Added in v.1.269


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