--- loncom/auth/lonroles.pm 2003/04/07 18:24:05 1.56 +++ loncom/auth/lonroles.pm 2003/06/18 13:13:10 1.60 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # User Roles Screen # -# $Id: lonroles.pm,v 1.56 2003/04/07 18:24:05 www Exp $ +# $Id: lonroles.pm,v 1.60 2003/06/18 13:13:10 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -50,6 +50,7 @@ use Apache::Constants qw(:common); use Apache::File(); use Apache::lonmenu; use Apache::loncommon; +use Apache::lonannounce; sub handler { @@ -151,10 +152,23 @@ ENDENTERKEY unless ($ENV{'request.course.id'}) { &Apache::lonnet::appenv( "request.course.id" => $cdom.'_'.$cnum); - $furl='/adm/notfound.html'; + $furl='/adm/roles'; $msg= - '

Could not initialize top-level map.

'; + '

Could not initialize course at this time.

Please try again.

'; } + + # Check to see if the user is a CC entering a course + # for the first time + my (undef, undef, $role, $courseid) = split(/\./, $envkey); + if (substr($courseid, 0, 1) eq '/') { + $courseid = substr($courseid, 1); + } + $courseid =~ s/\//_/; + if ($role eq 'cc' && $ENV{'course.' . $courseid . + '.course.helper.not.run'}) { + $furl = "/adm/helper/course.initialization.helper"; + } + $r->content_type('text/html'); &Apache::loncommon::no_cache($r); $r->send_http_header; @@ -262,7 +276,7 @@ ENDHEADER $r->print("Author and Co-Author roles may not be available on ". "servers other than your home server."); } else { - $r->print("

Enter a Course

\n"); + $r->print("

Select a Course to Enter

\n"); } if (($ENV{'REDIRECT_QUERY_STRING'}) && ($fn)) { $fn.='?'.$ENV{'REDIRECT_QUERY_STRING'}; @@ -437,6 +451,9 @@ ENDHEADER $r->print(' '); } } + $tremark.=&Apache::lonannounce::showday(time,1, + &Apache::lonannounce::readcalendar($tdom.'_'.$trest)); + $r->print(''.$trole. ''.$ttype. ''.$twhere.