Diff for /loncom/lonnet/perl/lonnet.pm between versions 1.52 and 1.53

version 1.52, 2000/10/28 17:26:35 version 1.53, 2000/10/28 19:26:07
Line 499  sub coursedescription { Line 499  sub coursedescription {
     if ($chome ne 'no_host') {      if ($chome ne 'no_host') {
        my $rep=reply("dump:$cdomain:$cnum:environment",$chome);         my $rep=reply("dump:$cdomain:$cnum:environment",$chome);
        if ($rep ne 'con_lost') {         if ($rep ne 'con_lost') {
    my %cachehash=();             my %envhash=();
            my %returnhash=('home'   => $chome,              my %returnhash=('home'   => $chome, 
                            'domain' => $cdomain,                             'domain' => $cdomain,
                            'num'    => $cnum);                             'num'    => $cnum);
Line 508  sub coursedescription { Line 508  sub coursedescription {
                $name=&unescape($name);                 $name=&unescape($name);
                $value=&unescape($value);                 $value=&unescape($value);
                $returnhash{$name}=$value;                 $returnhash{$name}=$value;
                if ($name eq 'description') {                 my $normalid=$courseid;
    $cachehash{$courseid}=$value;                 $normalid=~s/\//\_/g;
                }                 $envhash{'course.'.$normalid.'.'.$name}=$value;
            } split(/\&/,$rep);             } split(/\&/,$rep);
            $returnhash{'url'}='/res/'.declutter($returnhash{'url'});             $returnhash{'url'}='/res/'.declutter($returnhash{'url'});
            $returnhash{'fn'}=$perlvar{'lonDaemons'}.'/tmp/'.             $returnhash{'fn'}=$perlvar{'lonDaemons'}.'/tmp/'.
        $ENV{'user.name'}.'_'.$cdomain.'_'.$cnum;         $ENV{'user.name'}.'_'.$cdomain.'_'.$cnum;
    put ('nohist_coursedescriptions',%cachehash);             &appenv(%envhash);
            return %returnhash;             return %returnhash;
        }         }
     }      }
Line 785  sub allowed { Line 785  sub allowed {
            }             }
        }         }
        if (($ENV{'HTTP_REFERER'}) && ($checkreferer)) {         if (($ENV{'HTTP_REFERER'}) && ($checkreferer)) {
           my @uriparts=split(/\//,&declutter($ENV{'HTTP_REFERER'}));    my $refuri=&declutter($ENV{'HTTP_REFERER'});
             my @uriparts=split(/\//,$refuri);
           my $filename=$uriparts[$#uriparts];            my $filename=$uriparts[$#uriparts];
           my $pathname=$uri;            my $pathname=$refuri;
           $pathname=~s/\/$filename$//;            $pathname=~s/\/$filename$//;
           if ($ENV{'acc.res.'.$ENV{'request.course.id'}.'.'.$pathname}=~            my @filenameparts=split(/\./,$filename);
             if (&fileembstyle($filenameparts[$#filenameparts]) ne 'ssi') {
               if ($ENV{'acc.res.'.$ENV{'request.course.id'}.'.'.$pathname}=~
               /\&$filename\:(\d+)\&/) {                /\&$filename\:(\d+)\&/) {
               $statecond=$1;                my $refstatecond=$1;
               if ($ENV{'user.priv.'.$ENV{'request.role'}.'./'.$courseprivid}                if ($ENV{'user.priv.'.$ENV{'request.role'}.'./'.$courseprivid}
                   =~/$priv\&([^\:]*)/) {                    =~/$priv\&([^\:]*)/) {
                   $thisallowed.=$1;                    $thisallowed.=$1;
                     $uri=$refuri;
                     $statecond=$refstatecond;
               }                }
               }
           }            }
        }         }
    }     }
Line 874  sub allowed { Line 880  sub allowed {
 # Now user is definitely in a course  # Now user is definitely in a course
 #  #
   
   
   # Course preferences
   
      if ($thisallowed=~/C/) {
   #
   # Registered course preferences from environment
   #
      }
   
   # Resource preferences
   
      if ($thisallowed=~/R/) {
   #
   # Resource Metadata
   #
      }
   
 # Restricted by state?  # Restricted by state?
   
    if ($thisallowed=~/X/) {     if ($thisallowed=~/X/) {

Removed from v.1.52  
changed lines
  Added in v.1.53


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