version 1.10, 2003/06/23 19:59:54
|
version 1.13, 2004/06/27 17:14:28
|
Line 29
|
Line 29
|
package Apache::lonchatfetch; |
package Apache::lonchatfetch; |
|
|
use strict; |
use strict; |
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common :http); |
use Apache::lontexconvert; |
use Apache::lontexconvert; |
use Apache::loncommon; |
use Apache::loncommon; |
use Apache::lonnet; |
use Apache::lonnet; |
Line 37 use Apache::lonnet;
|
Line 37 use Apache::lonnet;
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
|
|
|
if (! &Apache::lonnet::allowed('pch',$ENV{'request.course.id'}. |
|
($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:'')) |
|
) { |
|
return HTTP_NOT_ACCEPTABLE; |
|
} |
|
|
my $loaderror=&Apache::lonnet::overloaderror($r); |
my $loaderror=&Apache::lonnet::overloaderror($r); |
if ($loaderror) { return $loaderror; } |
if ($loaderror) { return $loaderror; } |
$loaderror= |
$loaderror= |
Line 96 sub handler {
|
Line 102 sub handler {
|
&Apache::lonnet::unescape($msg)); |
&Apache::lonnet::unescape($msg)); |
$contrib=&Apache::lonnet::unescape($contrib); |
$contrib=&Apache::lonnet::unescape($contrib); |
$contrib=~s/\n/\<br \/\>/g; |
$contrib=~s/\n/\<br \/\>/g; |
$contrib=&Apache::lontexconvert::msgtexconverted($contrib); |
($contrib,my $errors)=&Apache::lontexconvert::msgtexconverted($contrib); |
|
if ($errors) { $contrib.="[Message not fully displayed due to incorrect embedded TeX]"; } |
|
if ($errors && $snum eq $ENV{'user.name'} && |
|
$sdom eq $ENV{'user.domain'} ) { |
|
$contrib.="<br />[TeX error message: $errors]"; |
|
} |
$contrib=~s/\n/ /g; |
$contrib=~s/\n/ /g; |
$contrib=~s/\'/\&\#39\;/g; |
$contrib=~s/\'/\&\#39\;/g; |
my $sender=''; |
my $sender=''; |
Line 113 sub handler {
|
Line 124 sub handler {
|
$sender=&Apache::loncommon::screenname($snum,$sdom); |
$sender=&Apache::loncommon::screenname($snum,$sdom); |
unless ($sender) { $sender="Anonymous"; } |
unless ($sender) { $sender="Anonymous"; } |
} |
} |
$sender=~s/\'/\"/g; |
$sender=~s/\'/\&\#39\;/g; |
my $color=$sender; |
my $color=$sender; |
$color=~tr/a-j/0-9/; |
$color=~tr/a-j/0-9/; |
$color=~tr/A-J/0-9/; |
$color=~tr/A-J/0-9/; |