--- loncom/auth/lonroles.pm 2000/12/08 21:57:25 1.18 +++ loncom/auth/lonroles.pm 2000/12/28 21:46:08 1.19 @@ -5,7 +5,8 @@ # 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,10/28,12/08 Gerd Kortemeyer +# 09/04,09/06,09/28,09/29,09/30,10/2,10/5,10/26,10/28, +# 12/08,12/28 Gerd Kortemeyer # package Apache::lonroles; @@ -47,7 +48,7 @@ sub handler { } if ($tend) { if ($tend<$then) { $tstatus='expired'; } - if ($tend>$now) { $tstatus='will_not'; } + if ($tend<$now) { $tstatus='will_not'; } } if ($tstatus eq 'is') { $where=~s/^\///; @@ -55,11 +56,15 @@ sub handler { &Apache::lonnet::appenv('request.role' => $trolecode, 'request.course.sec' => $csec); if ($cnum) { - &Apache::lonuserstate::readmap($cdom.'/'.$cnum); + my ($furl,$ferr)= + &Apache::lonuserstate::readmap($cdom.'/'.$cnum); if ($ENV{'form.orgurl'}) { $r->internal_redirect($ENV{'form.orgurl'}); return OK; - } + } else { + $r->internal_redirect($furl); + return OK; + } } } } @@ -140,12 +145,8 @@ ENDHEADER # ----------------------------------------------------------------------- Table $r->print(''); unless ($nochoose) { $r->print(''); } - if ($advanced) { $r->print(''. ''."\n"); - } else { - $r->print(''."\n"); - } foreach $envkey (sort keys %ENV) { if ($envkey=~/^user\.role\./) { @@ -166,7 +167,7 @@ ENDHEADER } if ($tend) { if ($tend<$then) { $tstatus='expired'; } - if ($tend>$now) { $tstatus='will_not'; } + if ($tend<$now) { $tstatus='will_not'; } $tpend=localtime($tend); } if ($ENV{'request.role'} eq $trolecode) { @@ -186,7 +187,7 @@ ENDHEADER $tbg='#AAFF77'; $tremark.='Expired after logout. '; } elsif ($tstatus eq 'selected') { - $tbg='#33FF33'; + $tbg='#11CC55'; $tremark.='Currently selected. '; } my $trole; @@ -243,7 +244,7 @@ ENDHEADER } my $tremark=''; if ($ENV{'request.role'} eq 'cm') { - $r->print(''); + $r->print(''); $tremark='Currently selected.'; } else { $r->print(''); @@ -310,15 +311,6 @@ ENDHEADER } } } -# -------------------------------------------------------------- Debug - remove - - $->print("

Debugging


\n"); - - foreach $envkey (sort keys %ENV) { - $r->print("$envkey ---- $ENV{$envkey}
"); - } - -# ------------------------------------------------------------------- End Debug $r->print("\n"); return OK;
 User RoleExtentStartEndRemark
Course