version 1.187, 2001/12/07 20:05:36
|
version 1.188, 2001/12/07 20:17:44
|
Line 172 use Apache::File;
|
Line 172 use Apache::File;
|
use LWP::UserAgent(); |
use LWP::UserAgent(); |
use HTTP::Headers; |
use HTTP::Headers; |
use vars |
use vars |
qw(%perlvar %hostname %homecache %hostip %spareid %hostdom %libserv %pr %prp %fe %fd %metacache %packagetab %courselogs %accesshash $processmarker $dumpcount); |
qw(%perlvar %hostname %homecache %hostip %spareid %hostdom |
|
%libserv %pr %prp %fe %fd %metacache %packagetab |
|
%courselogs %accesshash $processmarker $dumpcount |
|
%coursedombuf %coursehombuf); |
use IO::Socket; |
use IO::Socket; |
use GDBM_File; |
use GDBM_File; |
use Apache::Constants qw(:common :http); |
use Apache::Constants qw(:common :http); |
Line 755 sub flushcourselogs {
|
Line 758 sub flushcourselogs {
|
&logthis('Flushing course log buffers'); |
&logthis('Flushing course log buffers'); |
map { |
map { |
my $crsid=$_; |
my $crsid=$_; |
if (&reply('log:'.$ENV{'course.'.$crsid.'.domain'}.':'. |
if (&reply('log:'.$coursedombuf{$crsid}.':'. |
$ENV{'course.'.$crsid.'.num'}.':'. |
&escape($courselogs{$crsid}), |
&escape($courselogs{$crsid}), |
$coursehombuf{$crsid}) eq 'ok') { |
$ENV{'course.'.$crsid.'.home'}) eq 'ok') { |
|
delete $courselogs{$crsid}; |
delete $courselogs{$crsid}; |
} else { |
} else { |
&logthis('Failed to flush log buffer for '.$crsid); |
&logthis('Failed to flush log buffer for '.$crsid); |
Line 785 sub courselog {
|
Line 787 sub courselog {
|
my $what=shift; |
my $what=shift; |
$what=time.':'.$what; |
$what=time.':'.$what; |
unless ($ENV{'request.course.id'}) { return ''; } |
unless ($ENV{'request.course.id'}) { return ''; } |
|
$coursedombuf{$ENV{'request.course.id'}}= |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}.':'. |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.num'}; |
|
$coursehombuf{$ENV{'request.course.id'}}= |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.home'}; |
if (defined $courselogs{$ENV{'request.course.id'}}) { |
if (defined $courselogs{$ENV{'request.course.id'}}) { |
$courselogs{$ENV{'request.course.id'}}.='&'.$what; |
$courselogs{$ENV{'request.course.id'}}.='&'.$what; |
} else { |
} else { |
Line 1148 sub cstore {
|
Line 1155 sub cstore {
|
} keys %$storehash; |
} keys %$storehash; |
$namevalue=~s/\&$//; |
$namevalue=~s/\&$//; |
&courselog($symb.':'.$stuname.':'.$domain.':CSTORE:'.$namevalue); |
&courselog($symb.':'.$stuname.':'.$domain.':CSTORE:'.$namevalue); |
return critical("store:$domain:$stuname:$namespace:$symb:$namevalue","$home"); |
return critical |
|
("store:$domain:$stuname:$namespace:$symb:$namevalue","$home"); |
} |
} |
|
|
# --------------------------------------------------------------------- Restore |
# --------------------------------------------------------------------- Restore |
Line 1164 sub restore {
|
Line 1172 sub restore {
|
} else { |
} else { |
$symb=&escape($symb); |
$symb=&escape($symb); |
} |
} |
if (!$namespace) { unless ($namespace=$ENV{'request.course.id'}) { return ''; } } |
if (!$namespace) { |
|
unless ($namespace=$ENV{'request.course.id'}) { |
|
return ''; |
|
} |
|
} |
if (!$domain) { $domain=$ENV{'user.domain'}; } |
if (!$domain) { $domain=$ENV{'user.domain'}; } |
if (!$stuname) { $stuname=$ENV{'user.name'}; } |
if (!$stuname) { $stuname=$ENV{'user.name'}; } |
if (!$home) { $home=$ENV{'user.home'}; } |
if (!$home) { $home=$ENV{'user.home'}; } |