version 1.465, 2022/11/23 02:55:37
|
version 1.466, 2022/12/01 01:28:26
|
Line 3978 sub update_roles {
|
Line 3978 sub update_roles {
|
my $now=time; |
my $now=time; |
my @rolechanges; |
my @rolechanges; |
my (%disallowed,%got_role_approvals,%got_instdoms,%process_by,%instdoms, |
my (%disallowed,%got_role_approvals,%got_instdoms,%process_by,%instdoms, |
%pending,%reject,%notifydc); |
%pending,%reject,%notifydc,%status,%unauthorized,%currqueued); |
$got_role_approvals{$context} = ''; |
$got_role_approvals{$context} = ''; |
$process_by{$context} = {}; |
$process_by{$context} = {}; |
my @domroles = &Apache::lonuserutils::domain_roles(); |
my @domroles = &Apache::lonuserutils::domain_roles(); |
Line 4101 sub update_roles {
|
Line 4101 sub update_roles {
|
next if (&Apache::lonuserutils::restricted_dom($context,$id,$udom, |
next if (&Apache::lonuserutils::restricted_dom($context,$id,$udom, |
$uname,$role,$now,0,$cdom,$cnum,$csec,$credits, |
$uname,$role,$now,0,$cdom,$cnum,$csec,$credits, |
\%process_by,\%instdoms,\%got_role_approvals, |
\%process_by,\%instdoms,\%got_role_approvals, |
\%got_instdoms,\%reject,\%pending,\%notifydc)); |
\%got_instdoms,\%reject,\%pending,\%notifydc, |
|
\%status,\%unauthorized,\%currqueued)); |
} |
} |
my $result = &Apache::loncommon::commit_studentrole(\$logmsg,$udom,$uname,$url,$role,$now,0,$cdom,$cnum,$csec,$context,$credits); |
my $result = &Apache::loncommon::commit_studentrole(\$logmsg,$udom,$uname,$url,$role,$now,0,$cdom,$cnum,$csec,$context,$credits); |
if (($result =~ /^error/) || ($result eq 'not_in_class') || ($result eq 'unknown_course') || ($result eq 'refused')) { |
if (($result =~ /^error/) || ($result eq 'not_in_class') || ($result eq 'unknown_course') || ($result eq 'refused')) { |
Line 4131 sub update_roles {
|
Line 4132 sub update_roles {
|
next if (&Apache::lonuserutils::restricted_dom($context,$id,$udom, |
next if (&Apache::lonuserutils::restricted_dom($context,$id,$udom, |
$uname,$role,$now,0,$cdom,$cnum,$csec,'',\%process_by, |
$uname,$role,$now,0,$cdom,$cnum,$csec,'',\%process_by, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%pending,\%notifydc)); |
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued)); |
} |
} |
} |
} |
my $result=&Apache::lonnet::assignrole($env{'form.ccdomain'}, |
my $result=&Apache::lonnet::assignrole($env{'form.ccdomain'}, |
Line 4160 sub update_roles {
|
Line 4161 sub update_roles {
|
next if (&Apache::lonuserutils::restricted_dom($context,$id,$udom, |
next if (&Apache::lonuserutils::restricted_dom($context,$id,$udom, |
$uname,$role,$now,0,$cdom,$cnum,$csec,'',\%process_by, |
$uname,$role,$now,0,$cdom,$cnum,$csec,'',\%process_by, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%pending,\%notifydc)); |
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued)); |
} |
} |
} |
} |
my $result = &Apache::lonnet::assigncustomrole( |
my $result = &Apache::lonnet::assigncustomrole( |
Line 4203 sub update_roles {
|
Line 4204 sub update_roles {
|
next if (&Apache::lonuserutils::restricted_dom($context,$id,$udom, |
next if (&Apache::lonuserutils::restricted_dom($context,$id,$udom, |
$uname,$role,$start,$end,$one,$two,'','',\%process_by, |
$uname,$role,$start,$end,$one,$two,'','',\%process_by, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%pending,\%notifydc)); |
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued)); |
} |
} |
$r->print(&Apache::loncommon::commit_customrole($udom,$uname,$url,$three,$four,$five,$start,$end,$context)); |
$r->print(&Apache::loncommon::commit_customrole($udom,$uname,$url,$three,$four,$five,$start,$end,$context)); |
} else { |
} else { |
Line 4223 sub update_roles {
|
Line 4224 sub update_roles {
|
next if (&Apache::lonuserutils::restricted_dom($context,$secid,$udom, |
next if (&Apache::lonuserutils::restricted_dom($context,$secid,$udom, |
$uname,$role,$start,$end,$one,$two,$sec,'',\%process_by, |
$uname,$role,$start,$end,$one,$two,$sec,'',\%process_by, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%pending,\%notifydc)); |
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued)); |
} |
} |
$numchanges ++; |
$numchanges ++; |
$r->print(&Apache::loncommon::commit_customrole($udom,$uname,$securl,$three,$four,$five,$start,$end,$context)); |
$r->print(&Apache::loncommon::commit_customrole($udom,$uname,$securl,$three,$four,$five,$start,$end,$context)); |
Line 4266 sub update_roles {
|
Line 4267 sub update_roles {
|
next if (&Apache::lonuserutils::restricted_dom($context,$id,$udom, |
next if (&Apache::lonuserutils::restricted_dom($context,$id,$udom, |
$uname,$three,$start,$end,$one,$two,'',$credits,\%process_by, |
$uname,$three,$start,$end,$one,$two,'',$credits,\%process_by, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%pending,\%notifydc)); |
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued)); |
} |
} |
$numchanges ++; |
$numchanges ++; |
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$three,$start,$end,$one,$two,'',$context,$credits)); |
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$three,$start,$end,$one,$two,'',$context,$credits)); |
Line 4290 sub update_roles {
|
Line 4291 sub update_roles {
|
$restricted = &Apache::lonuserutils::restricted_dom($context,$secid,$udom, |
$restricted = &Apache::lonuserutils::restricted_dom($context,$secid,$udom, |
$uname,$three,$start,$end,$one,$two,$sec,$credits,\%process_by, |
$uname,$three,$start,$end,$one,$two,$sec,$credits,\%process_by, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%pending,\%notifydc); |
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued); |
next if ($restricted); |
next if ($restricted); |
} |
} |
$numchanges ++; |
$numchanges ++; |
Line 4305 sub update_roles {
|
Line 4306 sub update_roles {
|
$restricted = &Apache::lonuserutils::restricted_dom($context,$id,$udom, |
$restricted = &Apache::lonuserutils::restricted_dom($context,$id,$udom, |
$uname,$three,$start,$end,$one,$two,'',$credits,\%process_by, |
$uname,$three,$start,$end,$one,$two,'',$credits,\%process_by, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%pending,\%notifydc); |
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued); |
next if ($restricted); |
next if ($restricted); |
} |
} |
$numchanges ++; |
$numchanges ++; |
Line 4338 sub update_roles {
|
Line 4339 sub update_roles {
|
$restricted = &Apache::lonuserutils::restricted_dom($context,$id,$udom, |
$restricted = &Apache::lonuserutils::restricted_dom($context,$id,$udom, |
$uname,$two,$start,$end,$one,$two,'','',\%process_by, |
$uname,$two,$start,$end,$one,$two,'','',\%process_by, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%pending,\%notifydc); |
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued); |
next if ($restricted); |
next if ($restricted); |
} |
} |
$numchanges ++; |
$numchanges ++; |
Line 4354 sub update_roles {
|
Line 4355 sub update_roles {
|
$restricted = &Apache::lonuserutils::restricted_dom($context,$secid,$udom, |
$restricted = &Apache::lonuserutils::restricted_dom($context,$secid,$udom, |
$uname,$two,$start,$end,$one,$two,$sec,'',\%process_by, |
$uname,$two,$start,$end,$one,$two,$sec,'',\%process_by, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%pending,\%notifydc); |
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued); |
next if ($restricted); |
next if ($restricted); |
} |
} |
$numchanges ++; |
$numchanges ++; |
Line 4369 sub update_roles {
|
Line 4370 sub update_roles {
|
$restricted = &Apache::lonuserutils::restricted_dom($context,$id,$udom, |
$restricted = &Apache::lonuserutils::restricted_dom($context,$id,$udom, |
$uname,$two,$start,$end,$one,$two,'','',\%process_by, |
$uname,$two,$start,$end,$one,$two,'','',\%process_by, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
\%pending,\%notifydc); |
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued); |
next if ($restricted); |
next if ($restricted); |
} |
} |
$numchanges ++; |
$numchanges ++; |
Line 4399 sub update_roles {
|
Line 4400 sub update_roles {
|
} |
} |
} |
} |
} # End of foreach (keys(%env)) |
} # End of foreach (keys(%env)) |
if (keys(%reject)) { |
if ((keys(%reject)) || (keys(%unauthorized))) { |
$r->print(&Apache::lonuserutils::print_roles_rejected($context,\%reject)); |
$r->print(&Apache::lonuserutils::print_roles_rejected($context,\%reject,\%unauthorized)); |
} |
} |
if (keys(%pending)) { |
if ((keys(%pending)) || (keys(%currqueued))) { |
$r->print(&Apache::lonuserutils::print_roles_queued($context,\%pending,\%notifydc)); |
$r->print(&Apache::lonuserutils::print_roles_queued($context,\%pending,\%notifydc,\%currqueued)); |
} |
} |
# Flush the course logs so reverse user roles immediately updated |
# Flush the course logs so reverse user roles immediately updated |
$r->register_cleanup(\&Apache::lonnet::flushcourselogs); |
$r->register_cleanup(\&Apache::lonnet::flushcourselogs); |
Line 4460 sub enroll_single_student {
|
Line 4461 sub enroll_single_student {
|
} |
} |
} |
} |
my ($startdate,$enddate) = &Apache::lonuserutils::get_dates_from_form(); |
my ($startdate,$enddate) = &Apache::lonuserutils::get_dates_from_form(); |
my (%got_role_approvals,%got_instdoms,%process_by,%instdoms,%pending,%reject,%notifydc); |
my (%got_role_approvals,%got_instdoms,%process_by,%instdoms,%pending,%reject,%notifydc, |
|
%status,%unauthorized,%currqueued); |
unless ($env{'form.ccdomain'} eq $env{'course.'.$env{'request.course.id'}.'.domain'}) { |
unless ($env{'form.ccdomain'} eq $env{'course.'.$env{'request.course.id'}.'.domain'}) { |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
Line 4473 sub enroll_single_student {
|
Line 4475 sub enroll_single_student {
|
if (&Apache::lonuserutils::restricted_dom($context,$id,$env{'form.ccdomain'},$env{'form.ccuname'}, |
if (&Apache::lonuserutils::restricted_dom($context,$id,$env{'form.ccdomain'},$env{'form.ccuname'}, |
'st',$startdate,$enddate,$cdom,$cnum,$csec,$credits, |
'st',$startdate,$enddate,$cdom,$cnum,$csec,$credits, |
\%process_by,\%instdoms,\%got_role_approvals,\%got_instdoms, |
\%process_by,\%instdoms,\%got_role_approvals,\%got_instdoms, |
\%reject,\%pending,\%notifydc)) { |
\%reject,\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued)) { |
if (keys(%reject)) { |
if ((keys(%reject)) || (keys(%unauthorized))) { |
$r->print(&Apache::lonuserutils::print_roles_rejected($context,\%reject)); |
$r->print(&Apache::lonuserutils::print_roles_rejected($context,\%reject,\%unauthorized)); |
} |
} |
if (keys(%pending)) { |
if ((keys(%pending)) || (keys(%currqueued))) { |
$r->print(&Apache::lonuserutils::print_roles_queued($context,\%pending,\%notifydc)); |
$r->print(&Apache::lonuserutils::print_roles_queued($context,\%pending,\%notifydc,\%currqueued)); |
} |
} |
return; |
return; |
} |
} |
Line 7638 sub userlogdisplay_navlinks {
|
Line 7640 sub userlogdisplay_navlinks {
|
|
|
sub role_display_filter { |
sub role_display_filter { |
my ($context,$formname,$cdom,$cnum,$curr,$version,$crstype) = @_; |
my ($context,$formname,$cdom,$cnum,$curr,$version,$crstype) = @_; |
my $lctype; |
|
if ($context eq 'course') { |
|
$lctype = lc($crstype); |
|
} |
|
my $nolink = 1; |
my $nolink = 1; |
my $output = '<table><tr><td valign="top">'. |
my $output = '<table><tr><td valign="top">'. |
'<span class="LC_nobreak"><b>'.&mt('Changes/page:').'</b></span><br />'. |
'<span class="LC_nobreak"><b>'.&mt('Changes/page:').'</b></span><br />'. |
Line 7669 sub role_display_filter {
|
Line 7667 sub role_display_filter {
|
if ($curr->{'role'} eq 'any') { |
if ($curr->{'role'} eq 'any') { |
$output .= ' selected="selected"'; |
$output .= ' selected="selected"'; |
} |
} |
$output .= '>'.&mt('Any').'</option>'."\n"; |
$output .= '>'.&mt('Any').'</option>'."\n"; |
my @roles = &Apache::lonuserutils::roles_by_context($context,1,$crstype); |
my @roles = &Apache::lonuserutils::roles_by_context($context,1,$crstype); |
foreach my $role (@roles) { |
foreach my $role (@roles) { |
my $plrole; |
my $plrole; |