--- loncom/auth/lonroles.pm 2004/05/08 14:12:16 1.89 +++ loncom/auth/lonroles.pm 2004/05/08 16:26:32 1.90 @@ -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 @@ sub handler { 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').'
'. + 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). + '
'. &mt('Logout').''; + $buttontext=&mt('Re-Enter Key'); + } $r->print(<Verifying Course Access Key @@ -143,7 +157,7 @@ $swinfo
-$message +$message