--- loncom/interface/loncommon.pm 2006/04/25 20:48:38 1.354 +++ loncom/interface/loncommon.pm 2006/04/25 21:24:06 1.355 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.354 2006/04/25 20:48:38 albertel Exp $ +# $Id: loncommon.pm,v 1.355 2006/04/25 21:24:06 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2610,12 +2610,16 @@ sub maketime { ######################################### sub findallcourses { + my ($roles) = @_; + my %roles; + if (ref($roles)) { %roles = map { $_ => 1 } @{$roles}; } my %courses; my $now=time; foreach my $key (keys(%env)) { if ( $key=~m{^user\.role\.(\w+)\./(\w+)/(\w+)} ) { my ($role,$domain,$id) = ($1,$2,$3); next if ($role eq 'ca' || $role eq 'aa'); + next if (%roles && !exists($roles{$role})); my ($starttime,$endtime)=split(/\./,$env{$key}); my $active=1; if ($starttime) {