--- loncom/auth/lonroles.pm 2011/12/14 21:02:30 1.264 +++ loncom/auth/lonroles.pm 2012/06/01 16:00:29 1.267 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.264 2011/12/14 21:02:30 raeburn Exp $ +# $Id: lonroles.pm,v 1.267 2012/06/01 16:00:29 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -954,7 +954,12 @@ ENDHEADER $r->print('

'.&mt('Current Privileges').'

'); $r->print(&privileges_info()); } - $r->print(&Apache::lonnet::getannounce()); + my $announcements = &Apache::lonnet::getannounce(); + $r->print( + '
'. + '

'.&mt('Announcements').'

'. + $announcements + ) unless (!$announcements); if ($advanced) { my $esc_dom = &HTML::Entities::encode($env{'user.domain'},'"<>&'); $r->print('

' @@ -1613,19 +1618,17 @@ sub check_forcc { } else { $ccrole = 'cc'; } - if ($cdom ne '' && $cnum ne '') { - if (&Apache::lonnet::is_course($cdom,$cnum)) { - my $envkey = 'user.role.'.$ccrole.'./'.$cdom.'/'.$cnum; - if (defined($env{$envkey})) { - $is_cc = 1; - my ($tstart,$tend)=split(/\./,$env{$envkey}); - my $limit = $update; - if ($env{'request.role'} eq $ccrole.'./'.$cdom.'/'.$cnum) { - $limit = $then; - } - if ($tstart && $tstart>$refresh) { $is_cc = 0; } - if ($tend && $tend <$limit) { $is_cc = 0; } + if (&Apache::lonnet::is_course($cdom,$cnum)) { + my $envkey = 'user.role.'.$ccrole.'./'.$cdom.'/'.$cnum; + if (defined($env{$envkey})) { + $is_cc = 1; + my ($tstart,$tend)=split(/\./,$env{$envkey}); + my $limit = $update; + if ($env{'request.role'} eq $ccrole.'./'.$cdom.'/'.$cnum) { + $limit = $then; } + if ($tstart && $tstart>$refresh) { $is_cc = 0; } + if ($tend && $tend <$limit) { $is_cc = 0; } } } return $is_cc; @@ -2236,7 +2239,7 @@ sub update_session_roles { } $msg .= ''; } else { - $msg = ' '.$rolesmsg.'
'; + $msg = ' '.$rolesmsg.'

'; } return $msg; }