--- loncom/auth/lonroles.pm 2000/10/26 18:54:11 1.13
+++ loncom/auth/lonroles.pm 2000/10/26 21:43:18 1.15
@@ -53,7 +53,7 @@ sub handler {
$where=~s/^\///;
my ($cdom,$cnum,$csec)=split(/\//,$where);
&Apache::lonnet::appenv('request.role' => $trolecode,
- 'request.sec' => $csec);
+ 'request.course.sec' => $csec);
if ($cnum) {
&Apache::lonuserstate::readmap($cdom.'/'.$cnum);
if ($ENV{'form.orgurl'}) {
@@ -242,6 +242,22 @@ ENDHEADER
'
'.$tremark.' | '."\n");
}
}
+ my $tremark='';
+ if ($ENV{'request.role'} eq 'cm') {
+ $r->print('');
+ $tremark='Currently selected.';
+ } else {
+ $r->print('
');
+ }
+ unless ($nochoose) {
+ if ($ENV{'request.role'} ne 'cm') {
+ $r->print(' | ');
+ } else {
+ $r->print(' | ');
+ }
+ }
+ $r->print('No role specified'.
+ ' | '.$tremark.' |
'."\n");
$r->print('');
unless ($nochoose) {
@@ -249,19 +265,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};
+ if ($tsec) {
+ $twhere.=' (Section/Group: '.$tsec.')';
+ }
} elsif ($tdom) {
$ttype='Domain';
$twhere=$tdom;