version 1.182, 2005/01/12 16:18:54
|
version 1.183, 2005/01/12 20:58:26
|
Line 139 my $cuname;
|
Line 139 my $cuname;
|
my $cudom; |
my $cudom; |
|
|
my $registered_cleanup; |
my $registered_cleanup; |
|
my $modified_urls; |
|
|
=pod |
=pod |
|
|
Line 1545 sub phasetwo {
|
Line 1546 sub phasetwo {
|
$r->rflush; |
$r->rflush; |
|
|
# ------------------------------------------------------------- Trigger updates |
# ------------------------------------------------------------- Trigger updates |
print $logfile("\nRegistering for notifications: $target $source\n"); |
push(@{$modified_urls},[$target,$source]); |
push(@{$ENV{'internal.publication.targetsource'}},[$target,$source]); |
|
unless ($registered_cleanup) { |
unless ($registered_cleanup) { |
&Apache::lonnet::logthis('Cleanup handler registered'); |
|
$r->register_cleanup(\¬ify); |
$r->register_cleanup(\¬ify); |
$registered_cleanup=1; |
$registered_cleanup=1; |
} |
} |
Line 1580 sub phasetwo {
|
Line 1579 sub phasetwo {
|
# =============================================================== Notifications |
# =============================================================== Notifications |
sub notify { |
sub notify { |
# --------------------------------------------------- Send update notifications |
# --------------------------------------------------- Send update notifications |
&Apache::lonnet::logthis('Cleanup Phase Publication Handler'); |
foreach my $targetsource (@{$modified_urls}){ |
foreach my $targetsource (@{$ENV{'internal.publication.targetsource'}}){ |
|
my ($target,$source)=@{$targetsource}; |
my ($target,$source)=@{$targetsource}; |
my $logfile=Apache::File->new('>>'.$source.'.log'); |
my $logfile=Apache::File->new('>>'.$source.'.log'); |
print $logfile "\nCleanup phase: Notifications\n"; |
print $logfile "\nCleanup phase: Notifications\n"; |
Line 1824 sub handler {
|
Line 1822 sub handler {
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['filename']); |
['filename']); |
|
|
# ------------------------------------------------- Flag for registered cleanup |
# -------------------------------------- Flag and buffer for registered cleanup |
$registered_cleanup=0; |
$registered_cleanup=0; |
|
@{$modified_urls}=(); |
# -------------------------------------------------------------- Check filename |
# -------------------------------------------------------------- Check filename |
|
|
my $fn=&Apache::lonnet::unescape($ENV{'form.filename'}); |
my $fn=&Apache::lonnet::unescape($ENV{'form.filename'}); |