[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm /lonnet/perl lonnet.pm
www
lon-capa-cvs@mail.lon-capa.org
Sat, 08 May 2004 16:26:32 -0000
www Sat May 8 12:26:32 2004 EDT
Modified files:
/loncom/auth lonroles.pm
/loncom/lonnet/perl lonnet.pm
Log:
Saving my work.
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.89 loncom/auth/lonroles.pm:1.90
--- loncom/auth/lonroles.pm:1.89 Sat May 8 10:12:16 2004
+++ loncom/auth/lonroles.pm Sat May 8 12:26:32 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.89 2004/05/08 14:12:16 www Exp $
+# $Id: lonroles.pm,v 1.90 2004/05/08 16:26:32 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -129,9 +129,23 @@
my $swinfo=&Apache::lonmenu::rawconfig();
my $bodytag=&Apache::loncommon::bodytag
('Verifying Access Key to Unlock this Course');
- my $buttontext=&mt('Re-Enter Key');
- my $message=&mt('Key Verification Failed').'<br /><a href="/adm/logout">'.
+ my $buttontext=&mt('Enter Course');
+ my $message=&mt('Successfully registered key');
+ my $assignresult=
+ &Apache::lonnet::assign_access_key(
+ $ENV{'form.newkey'},
+ $authdom,$authnum,
+ $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>';
+ $buttontext=&mt('Re-Enter Key');
+ }
$r->print(<<ENDENTEREDKEY);
<head><title>Verifying Course Access Key</title>
</head>
@@ -143,7 +157,7 @@
<form method="post">
<input type="hidden" name="selectrole" value="1" />
<input type="hidden" name="$trolecode" value="1" />
-$message
+<font size="+2">$message</font><br />
<input type="submit" value="$buttontext" />
</form>
</body></html>
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.495 loncom/lonnet/perl/lonnet.pm:1.496
--- loncom/lonnet/perl/lonnet.pm:1.495 Fri May 7 13:17:50 2004
+++ loncom/lonnet/perl/lonnet.pm Sat May 8 12:26:32 2004
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.495 2004/05/07 17:17:50 albertel Exp $
+# $Id: lonnet.pm,v 1.496 2004/05/08 16:26:32 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -658,7 +658,7 @@
# the first time around
# ready to assign
$logentry=$1.'; '.$logentry;
- if (&put('accesskey',{$ckey=>$uname.':'.$udom.'#'.$logentry},
+ if (&put('accesskeys',{$ckey=>$uname.':'.$udom.'#'.$logentry},
$cdom,$cnum) eq 'ok') {
# key now belongs to user
my $envkey='key.'.$cdom.'_'.$cnum;