version 1.89, 2004/05/08 14:12:16
|
version 1.92, 2004/05/21 19:16:35
|
Line 47 sub redirect_user {
|
Line 47 sub redirect_user {
|
$r->send_http_header; |
$r->send_http_header; |
my $swinfo=&Apache::lonmenu::rawconfig(); |
my $swinfo=&Apache::lonmenu::rawconfig(); |
my $bodytag=&Apache::loncommon::bodytag('Switching Role'); |
my $bodytag=&Apache::loncommon::bodytag('Switching Role'); |
$r->print (<<ENDREDIR); |
# Note to style police: |
|
# This must only replace the spaces, nothing else, or it bombs elsewhere. |
|
$url=~s/ /\%20/g; |
|
$r->print (<<ENDREDIR); |
<head><title>$title</title> |
<head><title>$title</title> |
<meta HTTP-EQUIV="Refresh" CONTENT="1; url=$url"> |
<meta HTTP-EQUIV="Refresh" CONTENT="1; url=$url"> |
</head> |
</head> |
Line 129 sub handler {
|
Line 132 sub handler {
|
my $swinfo=&Apache::lonmenu::rawconfig(); |
my $swinfo=&Apache::lonmenu::rawconfig(); |
my $bodytag=&Apache::loncommon::bodytag |
my $bodytag=&Apache::loncommon::bodytag |
('Verifying Access Key to Unlock this Course'); |
('Verifying Access Key to Unlock this Course'); |
my $buttontext=&mt('Re-Enter Key'); |
my $buttontext=&mt('Enter Course'); |
my $message=&mt('Key Verification Failed').'<br /><a href="/adm/logout">'. |
my $message=&mt('Successfully registered key'); |
|
my $assignresult= |
|
&Apache::lonnet::assign_access_key( |
|
$ENV{'form.newkey'}, |
|
$authdom,$authnum, |
|
$cdom,$cnum, |
|
$ENV{'user.domain'}, |
|
$ENV{'user.name'}, |
|
'Assigned from '.$ENV{'REMOTE_ADDR'}.' at '.localtime().' for '. |
|
$trolecode); |
|
unless ($assignresult eq 'ok') { |
|
$assignresult=~s/^error\:\s*//; |
|
$message=&mt($assignresult). |
|
'<br /><a href="/adm/logout">'. |
&mt('Logout').'</a>'; |
&mt('Logout').'</a>'; |
|
$buttontext=&mt('Re-Enter Key'); |
|
} |
$r->print(<<ENDENTEREDKEY); |
$r->print(<<ENDENTEREDKEY); |
<head><title>Verifying Course Access Key</title> |
<head><title>Verifying Course Access Key</title> |
</head> |
</head> |
Line 143 $swinfo
|
Line 161 $swinfo
|
<form method="post"> |
<form method="post"> |
<input type="hidden" name="selectrole" value="1" /> |
<input type="hidden" name="selectrole" value="1" /> |
<input type="hidden" name="$trolecode" value="1" /> |
<input type="hidden" name="$trolecode" value="1" /> |
$message |
<font size="+2">$message</font><br /> |
<input type="submit" value="$buttontext" /> |
<input type="submit" value="$buttontext" /> |
</form> |
</form> |
</body></html> |
</body></html> |