Diff for /loncom/lonnet/perl/lonnet.pm between versions 1.326 and 1.332

version 1.326, 2003/02/13 19:07:46 version 1.332, 2003/03/01 15:13:58
Line 76  qw(%perlvar %hostname %homecache %badSer Line 76  qw(%perlvar %hostname %homecache %badSer
    %libserv %pr %prp %metacache %packagetab %titlecache      %libserv %pr %prp %metacache %packagetab %titlecache 
    %courselogs %accesshash $processmarker $dumpcount      %courselogs %accesshash $processmarker $dumpcount 
    %coursedombuf %coursehombuf %courseresdatacache      %coursedombuf %coursehombuf %courseresdatacache 
    %domaindescription);     %domaindescription %domain_auth_def %domain_auth_arg_def $tmpdir);
 use IO::Socket;  use IO::Socket;
 use GDBM_File;  use GDBM_File;
 use Apache::Constants qw(:common :http);  use Apache::Constants qw(:common :http);
Line 804  sub repcopy { Line 804  sub repcopy {
     }      }
 }  }
   
   # ------------------------------------------------ Get server side include body
   sub ssi_body {
       my $filelink=shift;
       my $output=($filelink=~/^http\:/?&externalssi($filelink):
                                        &ssi($filelink));
       $output=~s/^.*\<body[^\>]*\>//si;
       $output=~s/\<\/body\s*\>.*$//si;
       $output=~
               s/\/\/ BEGIN LON\-CAPA Internal.+\/\/ END LON\-CAPA Internal\s//gs;
       return $output;
   }
   
 # --------------------------------------------------------- Server Side Include  # --------------------------------------------------------- Server Side Include
   
 sub ssi {  sub ssi {
Line 1755  sub dump { Line 1767  sub dump {
   
 # --------------------------------------------------------------- currentdump  # --------------------------------------------------------------- currentdump
 sub currentdump {  sub currentdump {
    my ($sname,$sdom,$courseid)=@_;     my ($courseid,$sdom,$sname)=@_;
    $courseid = $ENV{'request.course.id'} if (! defined($courseid));     $courseid = $ENV{'request.course.id'} if (! defined($courseid));
    $sdom     = $ENV{'user.domain'}       if (! defined($sdom));     $sdom     = $ENV{'user.domain'}       if (! defined($sdom));
    $sname    = $ENV{'user.name'}         if (! defined($sname));     $sname    = $ENV{'user.name'}         if (! defined($sname));
Line 2157  sub is_on_map { Line 2169  sub is_on_map {
     my $filename=$uriparts[$#uriparts];      my $filename=$uriparts[$#uriparts];
     my $pathname=$uri;      my $pathname=$uri;
     $pathname=~s|/\Q$filename\E$||;      $pathname=~s|/\Q$filename\E$||;
       $pathname=~s/^adm\/wrapper\///;    
     #Trying to find the conditional for the file      #Trying to find the conditional for the file
     my $match=($ENV{'acc.res.'.$ENV{'request.course.id'}.'.'.$pathname}=~      my $match=($ENV{'acc.res.'.$ENV{'request.course.id'}.'.'.$pathname}=~
        /\&\Q$filename\E\:([\d\|]+)\&/);         /\&\Q$filename\E\:([\d\|]+)\&/);
Line 3573  BEGIN { Line 3586  BEGIN {
     }      }
 }  }
   
   # ------------------------------------------------------------ Read domain file
   {
       my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}.
                               '/domain.tab');
       %domaindescription = ();
       %domain_auth_def = ();
       %domain_auth_arg_def = ();
       if ($fh) {
          while (<$fh>) {
              next if /^\#/;
              chomp;
              my ($domain, $domain_description, $def_auth, $def_auth_arg)
                  = split(/:/,$_,4);
              $domain_auth_def{$domain}=$def_auth;
              $domain_auth_arg_def{$domain}=$def_auth_arg;
              $domaindescription{$domain}=$domain_description;
   #          &logthis("Domain.tab: $domain, $domain_auth_def{$domain}, $domain_auth_arg_def{$domain},$domaindescription{$domain}");
   #          &logthis("Domain.tab: $domain ".$domaindescription{$domain} );
          }
       }
   }
   
   
 # ------------------------------------------------------------- Read hosts file  # ------------------------------------------------------------- Read hosts file
 {  {
     my $config=Apache::File->new("$perlvar{'lonTabDir'}/hosts.tab");      my $config=Apache::File->new("$perlvar{'lonTabDir'}/hosts.tab");
Line 3586  BEGIN { Line 3622  BEGIN {
  $hostdom{$id}=$domain;   $hostdom{$id}=$domain;
  $hostip{$id}=$ip;   $hostip{$id}=$ip;
  $iphost{$ip}=$id;   $iphost{$ip}=$id;
  if ($domdescr) { $domaindescription{$domain}=$domdescr; }  
  if ($role eq 'library') { $libserv{$id}=$name; }   if ($role eq 'library') { $libserv{$id}=$name; }
        } else {         } else {
  if ($configline) {   if ($configline) {
Line 3648  BEGIN { Line 3683  BEGIN {
     }      }
 }  }
   
   # ------------- set up temporary directory
   {
       $tmpdir = $perlvar{'lonDaemons'}.'/tmp/';
   
   }
   
 %metacache=();  %metacache=();
   
 $processmarker='_'.time.'_'.$perlvar{'lonHostID'};  $processmarker='_'.time.'_'.$perlvar{'lonHostID'};

Removed from v.1.326  
changed lines
  Added in v.1.332


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