--- loncom/auth/lonroles.pm 2022/10/05 16:11:26 1.367
+++ loncom/auth/lonroles.pm 2025/02/23 05:16:01 1.376
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.367 2022/10/05 16:11:26 raeburn Exp $
+# $Id: lonroles.pm,v 1.376 2025/02/23 05:16:01 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -181,6 +181,7 @@ document.body.addEventListener('click',
ENDREDIR
}
+ $r->print('
'."\n");
return;
}
@@ -210,6 +211,7 @@ $msg
// ]]>
$link
+
$end_page
END
return;
@@ -444,6 +446,12 @@ sub handler {
$reqauthor = &Apache::loncoursequeueadmin::process_reqauthor(\$update);
}
+# ------------------------------------------------- Check for approval results
+ my $approvalresult;
+ if (($env{'form.approvals'} eq 'show') && ($env{'form.state'} eq 'done')) {
+ $approvalresult = &Apache::loncoursequeueadmin::update_request_queue('othdombyuser',
+ $env{'user.domain'});
+ }
my $envkey;
my %dcroles = ();
my %helpdeskroles = ();
@@ -499,6 +507,7 @@ sub handler {
"request.course.sec" => '',
"request.course.tied" => '',
"request.course.timechecked" => '',
+ "request.course.suppupdated" => '',
"request.role" => 'cm',
"request.role.adv" => $env{'user.adv'},
"request.role.domain" => $env{'user.domain'}});
@@ -675,17 +684,24 @@ sub handler {
$env{'environment.key.'.$cdom.'_'.$cnum},
$authdom,$authnum)) {
# there is no valid key
+ my $swinfo=&Apache::lonmenu::rawconfig();
+ my $crumbtext = 'User Roles';
+ my $show_course=&Apache::loncommon::show_course();
+ if ($show_course) {
+ $crumbtext = 'Courses';
+ }
if ($env{'form.newkey'}) {
# student attempts to register a new key
&Apache::loncommon::content_type($r,'text/html');
&Apache::loncommon::no_cache($r);
$r->send_http_header;
- my $swinfo=&Apache::lonmenu::rawconfig();
+ my $pagetitle = 'Verifying Access Key to Unlock this Course';
+ my $brcrum =[{href=>"/adm/roles",text=>$crumbtext},
+ {href=>"/adm/roles",text=>'Verify Access Key'}];
my $start_page=&Apache::loncommon::start_page
- ('Verifying Access Key to Unlock this Course');
+ ($pagetitle, undef,{bread_crumbs=>$brcrum,});
my $end_page=&Apache::loncommon::end_page();
- my $buttontext=&mt('Enter Course');
- my $message=&mt('Successfully registered key');
+ my ($buttontext,$message,$inputitem,$accessheader);
my $ip = &Apache::lonnet::get_requestor_ip();
my $assignresult=
&Apache::lonnet::assign_access_key(
@@ -696,41 +712,63 @@ sub handler {
$env{'user.name'},
&mt('Assigned from [_1] at [_2] for [_3]'
,$ip
- ,&Apache::lonlocal::locallocaltime()
+ ,&Apache::lonlocal::locallocaltime($now)
,$trolecode)
);
- unless ($assignresult eq 'ok') {
- $assignresult=~s/^error\:\s*//;
- $message=&mt($assignresult).
- '
'.
- &mt('Logout').'';
- $buttontext=&mt('Re-Enter Key');
- }
- $r->print(<&"')).'
'.
+ &mt('Result').': '.&mt($assignresult);
+ my $labeltext = &mt('Enter access key');
+ $inputitem = '';
+ }
+ $r->print(<<"ENDREGKEY");
$start_page
-