--- loncom/xml/lonxml.pm 2001/08/15 14:22:07 1.113
+++ loncom/xml/lonxml.pm 2001/08/15 15:49:14 1.114
@@ -162,25 +162,50 @@ sub checkout {
$tudom=$ENV{'user.domain'};
$tcrsid=$ENV{'request.course.id'};
}
+ my $now=time;
my $lonhost = $Apache::lonnet::perlvar{'lonHostID'};
my $infostr=&Apache::lonnet::escape(
$tuname.'&'.
$tudom.'&'.
$tcrsid.'&'.
$symb.'&'.
- time.'&'.$ENV{'REMOTE_ADDR'});
+ $now.'&'.$ENV{'REMOTE_ADDR'});
my $token=Apache::lonnet::reply('tmpput:'.$infostr,$lonhost);
if ($token=~/^error\:/) { return ''; }
$token=~s/^(\d+)\_.*\_(\d+)$/$1\*$2\*$lonhost/;
$token=~tr/a-z/A-Z/;
+
+ my %infohash=('token' => $token,
+ 'checktime' => $now,
+ 'remote' => $ENV{'REMOTE_ADDR'});
+
+ unless (
+ &Apache::lonnet::cstore(\%infohash,$symb,$tcrsid,$tudom,$tuname) eq 'ok') {
+ return '';
+ }
+
if (&Apache::lonnet::log($tudom,$tuname,
&Apache::lonnet::homeserver($tuname,$tudom),
&Apache::lonnet::escape('Checkout '.$infostr.' - '.
$token)) ne 'ok') {
return '';
}
+
+ my %reply=&Apache::lonnet::get('environment',
+ ['firstname','middlename','lastname','generation'],
+ $tudom,$tuname);
+ my $plainname=$reply{'firstname'}.' '.
+ $reply{'middlename'}.' '.
+ $reply{'lastname'}.' '.
+ $reply{'generation'};
+
if ($target eq 'web') {
- return '';
+ return 'Checked out for '.$plainname.
+ '
User: '.$tuname.' at '.$tudom.
+ '
CourseID: '.$tcrsid.')'.
+ '
DocID: '.$token.
+ '
Time: '.localtime($now).
+ '