Diff for /rat/lonuserstate.pm between versions 1.12 and 1.13

version 1.12, 2000/10/20 14:43:53 version 1.13, 2000/10/30 15:12:49
Line 11 Line 11
 # 7/1,7/3,7/4,7/7,7/8,7/10 Gerd Kortemeyer)  # 7/1,7/3,7/4,7/7,7/8,7/10 Gerd Kortemeyer)
 #  #
 # 7/15,7/17,7/18,8/1,8/2,8/4,8/5,8/21,8/22,8/23,8/30,  # 7/15,7/17,7/18,8/1,8/2,8/4,8/5,8/21,8/22,8/23,8/30,
 # 9/2,9/4,9/29,9/30,10/2,10/11 Gerd Kortemeyer  # 9/2,9/4,9/29,9/30,10/2,10/11,10/30 Gerd Kortemeyer
   
 package Apache::lonuserstate;  package Apache::lonuserstate;
   
Line 250  sub accinit { Line 250  sub accinit {
           map {            map {
              my $sub=$_;               my $sub=$_;
              my $orig=$_;               my $orig=$_;
              $sub=~/\(\((\d+\&(:?\d+\&)*)(?:\d+\&*)+\)(?:\|\(\1(?:\d+\&*)+\))+\)/;        $sub=~/\(\((\d+\&(:?\d+\&)*)(?:\d+\&*)+\)(?:\|\(\1(?:\d+\&*)+\))+\)/;
              my $factor=$1;               my $factor=$1;
              $sub=~s/$factor//g;               $sub=~s/$factor//g;
              $sub=~s/^\(/\($factor\(/;               $sub=~s/^\(/\($factor\(/;
Line 269  sub accinit { Line 269  sub accinit {
     } keys %hash;      } keys %hash;
     map {      map {
  if ($_=~/^ids/) {   if ($_=~/^ids/) {
     my $resid=$hash{$_};    map {
       my $resid=$_;
             my $uri=$hash{'src_'.$resid};              my $uri=$hash{'src_'.$resid};
             my @uriparts=split(/\//,$uri);              my @uriparts=split(/\//,$uri);
             my $urifile=$uriparts[$#uriparts];              my $urifile=$uriparts[$#uriparts];
             $#uriparts--;              $#uriparts--;
             my $uripath=join('/',@uriparts);              my $uripath=join('/',@uriparts);
             $uripath=~s/^\/res\///;              $uripath=~s/^\/res\///;
               my $uricond='0';
             if (defined($hash{'conditions_'.$resid})) {              if (defined($hash{'conditions_'.$resid})) {
   $urifile.=':'.$captured{$hash{'conditions_'.$resid}};    $uricond=$captured{$hash{'conditions_'.$resid}};
             } else {  
                 $urifile.=':0';  
             }              }
             if (defined($acchash{'acc.res.'.$short.'.'.$uripath})) {              if (defined($acchash{'acc.res.'.$short.'.'.$uripath})) {
  $acchash{'acc.res.'.$short.'.'.$uripath}.=$urifile.'&';                  if ($acchash{'acc.res.'.$short.'.'.$uripath}=~
                      /(\&$urifile\:[^\&]*)/) {
       my $replace=$1;
                       $acchash{'acc.res.'.$short.'.'.$uripath}
                        =~s/$replace/$replace\|$uricond/;
                   } else {
      $acchash{'acc.res.'.$short.'.'.$uripath}.=
                        $urifile.':'.$uricond.'&';
           }
             } else {              } else {
                 $acchash{'acc.res.'.$short.'.'.$uripath}='&'.$urifile.'&';                  $acchash{'acc.res.'.$short.'.'.$uripath}=
             }                   '&'.$urifile.':'.$uricond.'&';
         }              } 
            } split(/\,/,$hash{$_});
         }
     } keys %hash;      } keys %hash;
     my $courseuri=$uri;      my $courseuri=$uri;
     $courseuri=~s/^\/res\///;      $courseuri=~s/^\/res\///;

Removed from v.1.12  
changed lines
  Added in v.1.13


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