--- loncom/interface/loncommon.pm 2006/04/23 18:31:44 1.352 +++ 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.352 2006/04/23 18:31:44 albertel Exp $ +# $Id: loncommon.pm,v 1.355 2006/04/25 21:24:06 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1948,7 +1948,7 @@ sub plainname { $name=~s/^\s+//; $name=~s/\s+$//; $name=~s/\s+/ /g; - if ($name !~ /\S/) { $name=$uname.'@'.$udom; } + if ($name !~ /\S/) { $name=$uname.':'.$udom; } return $name; } @@ -2610,13 +2610,17 @@ 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'); - my ($starttime,$endtime)=$env{$key}; + next if (%roles && !exists($roles{$role})); + my ($starttime,$endtime)=split(/\./,$env{$key}); my $active=1; if ($starttime) { if ($now<$starttime) { $active=0; }