--- loncom/auth/lonroles.pm 2004/11/14 18:27:08 1.110 +++ loncom/auth/lonroles.pm 2004/11/19 20:17:52 1.111 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.110 2004/11/14 18:27:08 raeburn Exp $ +# $Id: lonroles.pm,v 1.111 2004/11/19 20:17:52 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -135,6 +135,13 @@ sub handler { if ($tstatus eq 'is') { $where=~s/^\///; my ($cdom,$cnum,$csec)=split(/\//,$where); +# store role if recent_role list being kept + if ($ENV{'environment.recentroles'}) { + &Apache::lonhtmlcommon::store_recent('roles', + $trolecode,' '); + } + + # check for keyed access if (($role eq 'st') && ($ENV{'course.'.$cdom.'_'.$cnum.'.keyaccess'} eq 'yes')) { @@ -604,6 +611,24 @@ ENDHEADER } if ($haverole) { $doheaders++; } } + + if ($ENV{'environment.recentroles'}) { + my %recent_roles = + &Apache::lonhtmlcommon::get_recent('roles',$ENV{'environment.recentrolesn'}); + my $output=''; + foreach (sort(keys(%recent_roles))) { + if (defined($roletext{'user.role.'.$_})) { + $output.=$roletext{'user.role.'.$_}; + } + } + if ($output) { + $r->print("". + &mt('Recent Roles').""); + $r->print($output); + $r->print(""); + } + } + if ($numdc > 0) { &display_recent_roles($r,\%roletext,\%recentroles); }