version 1.49, 2003/01/29 15:22:06
|
version 1.54, 2003/03/24 14:45:09
|
Line 36
|
Line 36
|
# 12/08,12/28, |
# 12/08,12/28, |
# YEAR=2001 |
# YEAR=2001 |
# 01/15/01 Gerd Kortemeyer |
# 01/15/01 Gerd Kortemeyer |
# 02/27/01 Scott Harrison |
|
# 03/02,05/03,05/25,05/30,06/01,07/06,08/06 Gerd Kortemeyer |
# 03/02,05/03,05/25,05/30,06/01,07/06,08/06 Gerd Kortemeyer |
# 12/21 Scott Harrison |
|
# 12/29 Gerd Kortemeyer |
# 12/29 Gerd Kortemeyer |
# |
# |
### |
### |
Line 95 sub handler {
|
Line 93 sub handler {
|
if ($tstatus eq 'is') { |
if ($tstatus eq 'is') { |
$where=~s/^\///; |
$where=~s/^\///; |
my ($cdom,$cnum,$csec)=split(/\//,$where); |
my ($cdom,$cnum,$csec)=split(/\//,$where); |
|
# check for keyed access |
|
if (($role eq 'st') && |
|
($ENV{'course.'.$cdom.'_'.$cnum.'.keyaccess'} eq 'yes')) { |
|
unless (&Apache::lonnet::validate_access_key( |
|
$ENV{'environment.key.'.$cdom.'_'.$cnum}, |
|
$cdom,$cnum)) { |
|
# there is no valid key |
|
if ($ENV{'form.newkey'}) { |
|
# student attempts to register a new key |
|
} else { |
|
# print form to enter a new key |
|
$r->content_type('text/html'); |
|
&Apache::loncommon::no_cache($r); |
|
$r->send_http_header; |
|
my $swinfo=&Apache::lonmenu::rawconfig(); |
|
my $bodytag=&Apache::loncommon::bodytag |
|
('Enter Access Key to Unlock this Course'); |
|
$r->print(<<ENDENTERKEY); |
|
<head><title>Entering Course Access Key</title> |
|
</head> |
|
<html> |
|
$bodytag |
|
<script> |
|
$swinfo |
|
</script> |
|
<form method="post"> |
|
<input type="hidden" name="selectrole" value="$ENV{'form.selectrole'}" /> |
|
<input type="text" size="20" name="newkey" value="$ENV{'form.newkey'}" /> |
|
<input type="submit" value="Enter key" /> |
|
</form> |
|
</body></html> |
|
ENDENTERKEY |
|
return OK; |
|
} |
|
} |
|
} |
&Apache::lonnet::appenv('request.role' => $trolecode, |
&Apache::lonnet::appenv('request.role' => $trolecode, |
'request.role.domain' => $cdom, |
'request.role.domain' => $cdom, |
'request.course.sec' => $csec); |
'request.course.sec' => $csec); |
Line 117 sub handler {
|
Line 151 sub handler {
|
$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; |
my $swinfo=&Apache::lonmenu::rawconfig($r); |
my $swinfo=&Apache::lonmenu::rawconfig(); |
my $bodytag=&Apache::loncommon::bodytag('Switching Role'); |
my $bodytag=&Apache::loncommon::bodytag('Switching Role'); |
print (<<ENDREDIR); |
print (<<ENDREDIR); |
<head><title>Entering Course</title> |
<head><title>Entering Course</title> |
Line 148 ENDREDIR
|
Line 182 ENDREDIR
|
$r->send_http_header; |
$r->send_http_header; |
return OK if $r->header_only; |
return OK if $r->header_only; |
|
|
my $swinfo=&Apache::lonmenu::rawconfig($r); |
my $swinfo=&Apache::lonmenu::rawconfig(); |
my $bodytag=&Apache::loncommon::bodytag('User Roles'); |
my $bodytag=&Apache::loncommon::bodytag('User Roles'); |
my $helptag=&Apache::loncommon::help_open_topic |
my $helptag=&Apache::loncommon::help_open_topic |
("General_Intro","<font size='+1'><b>CLICK HERE FOR HELP</b></font>"); |
("General_Intro","Click here for help"); |
$r->print(<<ENDHEADER); |
$r->print(<<ENDHEADER); |
<html> |
<html> |
<head> |
<head> |
Line 312 ENDHEADER
|
Line 346 ENDHEADER
|
my $home = &Apache::lonnet::homeserver($trest,$tdom); |
my $home = &Apache::lonnet::homeserver($trest,$tdom); |
if ($home ne $r->dir_config('lonHostID')) { |
if ($home ne $r->dir_config('lonHostID')) { |
$button=0; |
$button=0; |
$switchserver='http://'. |
$switchserver=&Apache::lonnet::escape('http://'. |
$Apache::lonnet::hostname{$home}.'/priv/'.$trest; |
$Apache::lonnet::hostname{$home}. |
|
'/adm/login?domain='.$ENV{'user.domain'}. |
|
'&username='.$ENV{'user.name'}. |
|
'&firsturl=/priv/'.$trest); |
} |
} |
#next if ($home eq 'no_host'); |
#next if ($home eq 'no_host'); |
$home = $Apache::lonnet::hostname{$home}; |
$home = $Apache::lonnet::hostname{$home}; |
Line 327 ENDHEADER
|
Line 364 ENDHEADER
|
($ENV{'user.name'},$ENV{'user.domain'}); |
($ENV{'user.name'},$ENV{'user.domain'}); |
if ($home ne $r->dir_config('lonHostID')) { |
if ($home ne $r->dir_config('lonHostID')) { |
$button=0; |
$button=0; |
$switchserver='http://'. |
$switchserver=&Apache::lonnet::escape('http://'. |
$Apache::lonnet::hostname{$home}.'/priv/'. |
$Apache::lonnet::hostname{$home}. |
$ENV{'user.name'}; |
'/adm/login?domain='.$ENV{'user.domain'}. |
|
'&username='.$ENV{'user.name'}. |
|
'&firsturl=/priv/'.$ENV{'user.name'}); |
} |
} |
#next if ($home eq 'no_host'); |
#next if ($home eq 'no_host'); |
$home = $Apache::lonnet::hostname{$home}; |
$home = $Apache::lonnet::hostname{$home}; |