Diff for /rat/lonuserstate.pm between versions 1.97 and 1.101

version 1.97, 2005/11/09 11:39:57 version 1.101, 2006/02/22 21:58:59
Line 31  package Apache::lonuserstate; Line 31  package Apache::lonuserstate;
   
 # ------------------------------------------------- modules used by this module  # ------------------------------------------------- modules used by this module
 use strict;  use strict;
 use Apache::Constants qw(:common :http);  
 use HTML::TokeParser;  use HTML::TokeParser;
 use Apache::lonnet;  use Apache::lonnet;
 use Apache::loncommon();  use Apache::loncommon();
Line 104  sub processversionfile { Line 103  sub processversionfile {
   
 sub loadmap {   sub loadmap { 
     my $uri=shift;      my $uri=shift;
     if ($hash{'map_pc_'.$uri}) { return OK; }      if ($hash{'map_pc_'.$uri}) { return; }
   
     $pc++;      $pc++;
     my $lpc=$pc;      my $lpc=$pc;
Line 119  sub loadmap { Line 118  sub loadmap {
     unless (($fn=~/\.sequence$/) ||      unless (($fn=~/\.sequence$/) ||
             ($fn=~/\.page$/)) {               ($fn=~/\.page$/)) { 
  $errtext.="Invalid map: $fn\n";   $errtext.="Invalid map: $fn\n";
  return OK;    return; 
     }      }
   
     my $instr=&Apache::lonnet::getfile($fn);      my $instr=&Apache::lonnet::getfile($fn);
Line 167  sub loadmap { Line 166  sub loadmap {
                         } elsif ($turi=~/^\/*uploaded\//) { # uploaded                          } elsif ($turi=~/^\/*uploaded\//) { # uploaded
     if (($embstyle eq 'img')       if (($embstyle eq 'img') 
  || ($embstyle eq 'emb')   || ($embstyle eq 'emb')
  || ($embstyle eq 'ign')   || ($embstyle eq 'wrp')) {
  || ($embstyle eq 'unk')) {  
                                 $turi='/adm/wrapper'.$turi;                                  $turi='/adm/wrapper'.$turi;
     } elsif ($embstyle eq 'ssi') {      } elsif ($embstyle eq 'ssi') {
  #do nothing with these   #do nothing with these
Line 179  sub loadmap { Line 177  sub loadmap {
     my $mapdir=$uri;      my $mapdir=$uri;
     $mapdir=~s/[^\/]+$//;      $mapdir=~s/[^\/]+$//;
     $turi=&Apache::lonnet::hreflocation($mapdir,$turi);      $turi=&Apache::lonnet::hreflocation($mapdir,$turi);
     if (($embstyle eq 'img') || ($embstyle eq 'emb')) {      if (($embstyle eq 'img') 
    || ($embstyle eq 'emb')
    || ($embstyle eq 'wrp')) {
  $turi='/adm/wrapper'.$turi;   $turi='/adm/wrapper'.$turi;
     }      }
                         }                          }
Line 318  sub loadmap { Line 318  sub loadmap {
   
 sub simplify {  sub simplify {
     my $expression=shift;      my $expression=shift;
   # (0&1) = 1
       $expression=~s/\(0\&(\d+)\)/$1/g;
 # (8)=8  # (8)=8
     $expression=~s/\((\d+)\)/$1/g;      $expression=~s/\((\d+)\)/$1/g;
 # 8&8=8  # 8&8=8
Line 327  sub simplify { Line 329  sub simplify {
 # (5&3)&4=5&3&4  # (5&3)&4=5&3&4
     $expression=~s/\((\d+)((?:\&\d+)+)\)\&(\d+\D)/$1$2\&$3/g;      $expression=~s/\((\d+)((?:\&\d+)+)\)\&(\d+\D)/$1$2\&$3/g;
 # (((5&3)|(4&6)))=((5&3)|(4&6))  # (((5&3)|(4&6)))=((5&3)|(4&6))
     $expression=~  #    $expression=~
  s/\((\(\(\d+(?:\&\d+)*\)(?:\|\(\d+(?:\&\d+)*\))+\))\)/$1/g;  # s/\((\(\(\d+(?:\&\d+)*\)(?:\|\(\d+(?:\&\d+)*\))+\))\)/$1/g;
 # ((5&3)|(4&6))|(1&2)=(5&3)|(4&6)|(1&2)  # ((5&3)|(4&6))|(1&2)=(5&3)|(4&6)|(1&2)
     $expression=~      $expression=~
  s/\((\(\d+(?:\&\d+)*\))((?:\|\(\d+(?:\&\d+)*\))+)\)\|(\(\d+(?:\&\d+)*\))/\($1$2\|$3\)/g;   s/\((\(\d+(?:\&\d+)*\))((?:\|\(\d+(?:\&\d+)*\))+)\)\|(\(\d+(?:\&\d+)*\))/\($1$2\|$3\)/g;
Line 443  sub accinit { Line 445  sub accinit {
     foreach (split(/\,/,$hash{$_})) {      foreach (split(/\,/,$hash{$_})) {
  my $resid=$_;   my $resid=$_;
  my $uri=$hash{'src_'.$resid};   my $uri=$hash{'src_'.$resid};
  $uri=~s/^\/adm\/wrapper//;   my ($uripath,$urifile) =
  $uri=&Apache::lonnet::declutter($uri);      &Apache::lonnet::split_uri_for_cond($uri);
  my @uriparts=split(/\//,$uri);  
  my $urifile=$uriparts[$#uriparts];  
  $#uriparts--;  
  my $uripath=join('/',@uriparts);  
  if ($uripath) {   if ($uripath) {
     my $uricond='0';      my $uricond='0';
     if (defined($hash{'conditions_'.$resid})) {      if (defined($hash{'conditions_'.$resid})) {

Removed from v.1.97  
changed lines
  Added in v.1.101


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