--- loncom/xml/lonxml.pm 2001/08/09 20:32:36 1.108 +++ loncom/xml/lonxml.pm 2001/08/10 15:49:46 1.109 @@ -13,7 +13,7 @@ # 6/12,6/13 H. K. Ng # 6/16 Gerd Kortemeyer # 7/27 H. K. Ng -# 8/7,8/9 Gerd Kortemeyer +# 8/7,8/9,8/10 Gerd Kortemeyer package Apache::lonxml; use vars @@ -97,6 +97,12 @@ sub xmlbegin { sub xmlend { my $discussion=''; if ($ENV{'request.course.id'}) { + my $crs='/'.$ENV{'request.course.id'}; + if ($ENV{'request.course.sec'}) { + $crs.='_'.$ENV{'request.course.sec'}; + } + $crs=~s/\_/\//g; + my $seeid=&Apache::lonnet::allowed('rin',$crs); my $symb=&Apache::lonnet::symbread(); if ($symb) { my %contrib=&Apache::lonnet::restore($symb,$ENV{'request.course.id'}, @@ -109,8 +115,15 @@ sub xmlend { for ($idx=1;$idx<=$contrib{'version'};$idx++) { my $message=$contrib{$idx.':message'}; $message=~s/\n/\
/g; - $discussion.='

'.$contrib{$idx.':sendername'}.' at '. - $contrib{$idx.':senderdomain'}.' ('. + my $sender='Anonymous'; + if ((!$contrib{$idx.':anonymous'}) || ($seeid)) { + $sender=$contrib{$idx.':sendername'}.' at '. + $contrib{$idx.':senderdomain'}; + if ($contrib{$idx.':anonymous'}) { + $sender.=' (anonymous)'; + } + } + $discussion.='

'.$sender.' ('. localtime($contrib{$idx.':timestamp'}). '):

'.$message. '

';