--- loncom/interface/loncommon.pm 2005/10/04 18:29:54 1.277 +++ loncom/interface/loncommon.pm 2005/10/14 20:16:46 1.280 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.277 2005/10/04 18:29:54 albertel Exp $ +# $Id: loncommon.pm,v 1.280 2005/10/14 20:16:46 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3082,6 +3082,7 @@ sub get_course_users { my $startidx = &Apache::loncoursedata::CL_START(); my $endidx = &Apache::loncoursedata::CL_END(); my ($classlist,$keylist)=&Apache::loncoursedata::get_classlist($cdom,$cnum); + my $now = time; foreach my $student (keys(%{$classlist})) { if (defined($$types{'active'})) { if ($$classlist{$student}[$statusidx] eq 'Active') { @@ -3089,12 +3090,12 @@ sub get_course_users { } } if (defined($$types{'previous'})) { - if ($$classlist{$student}[$endidx] <= time) { + if ($$classlist{$student}[$endidx] <= $now) { push(@{$$users{st}{$student}},'previous'); } } if (defined($$types{'future'})) { - if (($$classlist{$student}[$startidx] > 0) && ($$classlist{$student}[$endidx] > time) || ($$classlist{$student}[$endidx] == 0) || ($$classlist{$student}[$endidx] eq '')) { + if (($$classlist{$student}[$startidx] > $now) && ($$classlist{$student}[$endidx] > $now) || ($$classlist{$student}[$endidx] == 0) || ($$classlist{$student}[$endidx] eq '')) { push(@{$$users{st}{$student}},'future'); } } @@ -3117,6 +3118,15 @@ sub get_course_users { } } } + if (grep/^ow$/,@{$roles}) { + if ((defined($cdom)) && (defined($cnum))) { + my %csettings = &Apache::lonnet::get('environment',['internal.courseowner'],$cdom,$cnum); + if ( defined($csettings{'internal.courseowner'}) ) { + my $owner = $csettings{'internal.courseowner'}; + $$users{'ow'}{$owner.':'.$cdom} = 'any'; + } + } + } } return; } @@ -3706,7 +3716,7 @@ the routine &Apache::lonnet::transfer_pr my $uniq=0; sub get_cgi_id { $uniq=($uniq+1)%100000; - return (time.'_'.$uniq); + return (time.'_'.$$.'_'.$uniq); } ############################################################