--- loncom/auth/lonroles.pm 2012/05/14 04:17:16 1.265 +++ loncom/auth/lonroles.pm 2012/05/16 21:19:44 1.266 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.265 2012/05/14 04:17:16 raeburn Exp $ +# $Id: lonroles.pm,v 1.266 2012/05/16 21:19:44 droeschl Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1613,19 +1613,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;