version 1.55, 2003/03/24 18:46:44
|
version 1.60, 2003/06/18 13:13:10
|
Line 50 use Apache::Constants qw(:common);
|
Line 50 use Apache::Constants qw(:common);
|
use Apache::File(); |
use Apache::File(); |
use Apache::lonmenu; |
use Apache::lonmenu; |
use Apache::loncommon; |
use Apache::loncommon; |
|
use Apache::lonannounce; |
|
|
sub handler { |
sub handler { |
|
|
Line 72 sub handler {
|
Line 73 sub handler {
|
"request.course.uri" => '', |
"request.course.uri" => '', |
"request.course.sec" => '', |
"request.course.sec" => '', |
"request.role" => 'cm', |
"request.role" => 'cm', |
|
"request.role.adv" => $ENV{'user.adv'}, |
"request.role.domain" => $ENV{'user.domain'}); |
"request.role.domain" => $ENV{'user.domain'}); |
foreach $envkey (keys %ENV) { |
foreach $envkey (keys %ENV) { |
next if ($envkey!~/^user\.role\./); |
next if ($envkey!~/^user\.role\./); |
Line 129 ENDENTERKEY
|
Line 131 ENDENTERKEY
|
} |
} |
} |
} |
} |
} |
&Apache::lonnet::appenv('request.role' => $trolecode, |
my $tadv=0; |
'request.role.domain' => $cdom, |
if (($trolecode!~/^st/) && |
'request.course.sec' => $csec); |
($trolecode!~/^ta/) && |
|
($trolecode!~/^cm/)) { $tadv=1; } |
|
&Apache::lonnet::appenv( |
|
'request.role' => $trolecode, |
|
'request.role.adv' => $tadv, |
|
'request.role.domain' => $cdom, |
|
'request.course.sec' => $csec); |
my $msg='Entering course ...'; |
my $msg='Entering course ...'; |
if (($cnum) && ($role ne 'ca')) { |
if (($cnum) && ($role ne 'ca')) { |
my ($furl,$ferr)= |
my ($furl,$ferr)= |
Line 144 ENDENTERKEY
|
Line 152 ENDENTERKEY
|
unless ($ENV{'request.course.id'}) { |
unless ($ENV{'request.course.id'}) { |
&Apache::lonnet::appenv( |
&Apache::lonnet::appenv( |
"request.course.id" => $cdom.'_'.$cnum); |
"request.course.id" => $cdom.'_'.$cnum); |
$furl='/adm/notfound.html'; |
$furl='/adm/roles'; |
$msg= |
$msg= |
'<h1><font color=red>Could not initialize top-level map.</font></h1>'; |
'<h1><font color=red>Could not initialize course at this time.</font></h1><h3>Please try again.</h3>'; |
} |
} |
|
|
|
# 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'); |
$r->content_type('text/html'); |
&Apache::loncommon::no_cache($r); |
&Apache::loncommon::no_cache($r); |
$r->send_http_header; |
$r->send_http_header; |
Line 255 ENDHEADER
|
Line 276 ENDHEADER
|
$r->print("Author and Co-Author roles may not be available on ". |
$r->print("Author and Co-Author roles may not be available on ". |
"servers other than your home server."); |
"servers other than your home server."); |
} else { |
} else { |
$r->print("<h2>Enter a Course</h2>\n"); |
$r->print("<h2>Select a Course to Enter</h2>\n"); |
} |
} |
if (($ENV{'REDIRECT_QUERY_STRING'}) && ($fn)) { |
if (($ENV{'REDIRECT_QUERY_STRING'}) && ($fn)) { |
$fn.='?'.$ENV{'REDIRECT_QUERY_STRING'}; |
$fn.='?'.$ENV{'REDIRECT_QUERY_STRING'}; |
Line 430 ENDHEADER
|
Line 451 ENDHEADER
|
$r->print('<td> </td>'); |
$r->print('<td> </td>'); |
} |
} |
} |
} |
|
$tremark.=&Apache::lonannounce::showday(time,1, |
|
&Apache::lonannounce::readcalendar($tdom.'_'.$trest)); |
|
|
$r->print('<td><font color="'.$tfont.'">'.$trole. |
$r->print('<td><font color="'.$tfont.'">'.$trole. |
'</font></td><td><font color="'.$tfont.'">'.$ttype. |
'</font></td><td><font color="'.$tfont.'">'.$ttype. |
'</font></td><td><font color="'.$tfont.'">'.$twhere. |
'</font></td><td><font color="'.$tfont.'">'.$twhere. |