--- loncom/auth/lonroles.pm 2000/10/26 20:10:47 1.14 +++ loncom/auth/lonroles.pm 2000/10/28 19:23:21 1.16 @@ -5,7 +5,7 @@ # 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14 Gerd Kortemeyer) # 11/23 Gerd Kortemeyer) # 1/14,03/06,06/01,07/22,07/24,07/25, -# 09/04,09/06,09/28,09/29,09/30,10/2,10/5,10/26 Gerd Kortemeyer +# 09/04,09/06,09/28,09/29,09/30,10/2,10/5,10/26,10/28 Gerd Kortemeyer # package Apache::lonroles; @@ -99,10 +99,6 @@ ENDHEADER } } -# ---------------------------------------------- Get cached course descriptions - - my %cdes=Apache::lonnet::dump('nohist_coursedescriptions'); - # -------------------------------------------------------- Generate Page Output # --------------------------------------------------------------- Error Header? if ($error) { @@ -207,17 +203,17 @@ ENDHEADER if ($tsection) { $ttype.='
Section/Group: '.$tsection; } - my $tcourseid=$tdom.'/'.$trest; - if ($cdes{$tcourseid}) { - $twhere=$cdes{$tcourseid}; + my $tcourseid=$tdom.'_'.$trest; + if ($ENV{'course.'.$tcourseid.'.description'}) { + $twhere=$ENV{'course.'.$tcourseid.'.description'}; } else { my %newhash=Apache::lonnet::coursedescription($tcourseid); if (%newhash) { $twhere=$newhash{'description'}; } else { $twhere='Currently not available'; + $ENV{'course.'.$tcourseid.'.description'}=$twhere; } - $cdes{$tcourseid}=$twhere; } } elsif ($tdom) { $ttype='Domain'; @@ -265,19 +261,22 @@ ENDHEADER } # ------------------------------------------------------------ Priviledges Info if ($advanced) { - $r->print('

Priviledges

'); + $r->print('

Current Priviledges

'); foreach $envkey (sort keys %ENV) { - if ($envkey=~/^user\.priv\./) { - my ($dum1,$dum2,@pwhere)=split(/\./,$envkey); - my $where=join('.',@pwhere); + if ($envkey=~/^user\.priv\.$ENV{'request.role'}\./) { + my $where=$envkey; + $where=~s/^user\.priv\.$ENV{'request.role'}\.//; my $ttype; my $twhere; - my ($tdom,$trest)= + my ($tdom,$trest,$tsec)= split(/\//,Apache::lonnet::declutter($where)); if ($trest) { $ttype='Course'; - $twhere=$cdes{$tdom.'/'.$trest}; + $twhere=$ENV{'course.'.$tdom.'_'.$trest.'.description'}; + if ($tsec) { + $twhere.=' (Section/Group: '.$tsec.')'; + } } elsif ($tdom) { $ttype='Domain'; $twhere=$tdom;