version 1.106, 2019/01/27 15:46:26
|
version 1.107, 2019/07/25 20:23:52
|
Line 119 use Apache::loncoursequeueadmin;
|
Line 119 use Apache::loncoursequeueadmin;
|
use Apache::lonuserutils; |
use Apache::lonuserutils; |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
|
|
|
my $registered_flush; |
|
my $registered_instcats; |
|
my $modified_dom; |
|
|
sub handler { |
sub handler { |
my ($r) = @_; |
my ($r) = @_; |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
Line 127 sub handler {
|
Line 131 sub handler {
|
return OK; |
return OK; |
} |
} |
|
|
|
$registered_flush = 0; |
|
$registered_instcats = 0; |
|
$modified_dom = ''; |
|
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['action','showdom','cnum','state','crstype','queue','tabs']); |
['action','showdom','cnum','state','crstype','queue','tabs']); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
Line 3887 sub process_request {
|
Line 3895 sub process_request {
|
} |
} |
$output .= '</p>'; |
$output .= '</p>'; |
$creationresult = 'created'; |
$creationresult = 'created'; |
|
# Flush the course logs so reverse user roles immediately updated |
|
unless ($registered_flush) { |
|
my $handlers = $r->get_handlers('PerlCleanupHandler'); |
|
$r->set_handlers('PerlCleanupHandler' => [\&Apache::lonnet::flushcourselogs,@{$handlers}]); |
|
$registered_flush=1; |
|
} |
|
if ($instcode ne '') { |
|
&Apache::lonnet::devalidate_cache_new('instcats',$dom); |
|
# Update cache of self-cataloging courses on institution's server(s). |
|
if (&Apache::lonnet::shared_institution($dom)) { |
|
unless ($registered_instcats) { |
|
my $handlers = $r->get_handlers('PerlCleanupHandler'); |
|
$r->set_handlers('PerlCleanupHandler' => [\&devalidate_remote_instcats,@{$handlers}]); |
|
$registered_instcats=1; |
|
$modified_dom = $dom; |
|
} |
|
} |
|
} |
} else { |
} else { |
$output = '<span class="LC_error">'; |
$output = '<span class="LC_error">'; |
if ($crstype eq 'community') { |
if ($crstype eq 'community') { |
Line 4022 sub process_request {
|
Line 4048 sub process_request {
|
} |
} |
} |
} |
|
|
|
sub devalidate_remote_instcats { |
|
if ($modified_dom ne '') { |
|
my %servers = &Apache::lonnet::internet_dom_servers($modified_dom); |
|
my %thismachine; |
|
map { $thismachine{$_} = 1; } &Apache::lonnet::current_machine_ids(); |
|
if (keys(%servers)) { |
|
foreach my $server (keys(%servers)) { |
|
next if ($thismachine{$server}); |
|
&Apache::lonnet::remote_devalidate_cache($server,['instcats:'.$modified_dom]); |
|
} |
|
} |
|
$modified_dom = ''; |
|
} |
|
return; |
|
} |
|
|
sub custom_formitems { |
sub custom_formitems { |
my ($preprocess,$customhash) = @_; |
my ($preprocess,$customhash) = @_; |
return unless ((ref($preprocess) eq 'HASH') && (ref($customhash) eq 'HASH')); |
return unless ((ref($preprocess) eq 'HASH') && (ref($customhash) eq 'HASH')); |