--- loncom/interface/lonmainmenu.pm 2010/10/04 18:54:46 1.8.4.8 +++ loncom/interface/lonmainmenu.pm 2010/10/07 15:25:08 1.8.4.9 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # displays the main menu # -# $Id: lonmainmenu.pm,v 1.8.4.8 2010/10/04 18:54:46 raeburn Exp $ +# $Id: lonmainmenu.pm,v 1.8.4.9 2010/10/07 15:25:08 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -61,7 +61,7 @@ sub handler { gci_5422913620b814c90gcil1 => 'tutorial', ); if (($custommenu && $cid ne '' && ($gcicourses{$cid} || $env{'request.role'} !~ m{^cc\./gcitest/})) || - ($env{'user.domain'} eq 'gcitest')) { + ($cid ne '' && $env{'user.domain'} eq 'gcitest')) { $r->internal_redirect('/adm/navmaps'); return OK; } @@ -95,10 +95,14 @@ ENDSCRIPT $r->print(&Apache::loncommon::start_page('Main Menu',$script_tag,$args)); my ($rolecount,$numcourses) = (0,0); + my $now = time; unless (($custommenu) || ($env{'user.domain'} eq 'gcitest')) { foreach my $envkey (keys(%env)) { next unless ($envkey =~ /^user\.role\./); - $rolecount ++; + my ($start,$end) = split(/\./,$env{$envkey}); + if (($start eq '' || $start <= $now) && ($end eq '' || $end > $now)) { + $rolecount ++; + } } } if ($custommenu) {