version 1.33, 2009/02/25 16:39:54
|
version 1.40, 2021/11/30 15:55:37
|
Line 63 sub handler {
|
Line 63 sub handler {
|
'<b>'.&unescape($group_info{description}). |
'<b>'.&unescape($group_info{description}). |
'</b><br />'; |
'</b><br />'; |
} |
} |
} elsif (! &Apache::lonnet::allowed('pch',$env{'request.course.id'}. |
} elsif (! &Apache::lonnet::allowed('plc',$env{'request.course.id'}. |
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')) |
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')) |
) { |
) { |
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
} |
} |
|
|
my $loaderror=&Apache::lonnet::overloaderror($r); |
|
if ($loaderror) { return $loaderror; } |
|
$loaderror= |
|
&Apache::lonnet::overloaderror($r, |
|
$env{'course.'.$env{'request.course.id'}.'.home'}); |
|
if ($loaderror) { return $loaderror; } |
|
|
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
return OK if $r->header_only; |
return OK if $r->header_only; |
Line 128 sub handler {
|
Line 121 sub handler {
|
$contrib=&unescape($contrib); |
$contrib=&unescape($contrib); |
&Apache::lonfeedback::newline_to_br(\$contrib); |
&Apache::lonfeedback::newline_to_br(\$contrib); |
($contrib,my $errors)=&Apache::lontexconvert::msgtexconverted($contrib); |
($contrib,my $errors)=&Apache::lontexconvert::msgtexconverted($contrib); |
if ($errors) { $contrib.=&mt('[Message not fully displayed due to incorrect embedded TeX]'); } |
if ($errors) { |
|
$contrib.=' <span class="LC_error">' |
|
.&mt('(Message not fully displayed due to incorrect embedded TeX.)') |
|
.'</span>'; |
|
} |
if ($errors && $snum eq $env{'user.name'} && |
if ($errors && $snum eq $env{'user.name'} && |
$sdom eq $env{'user.domain'} ) { |
$sdom eq $env{'user.domain'} ) { |
$contrib.='<br />'.&mt('[TeX error message: [_1]',$errors); |
$contrib.='<br /><span class="LC_error">' |
|
.&mt('TeX error message: [_1]',$errors) |
|
.'</span>'; |
} |
} |
$contrib=~s/\n/ /g; |
$contrib=~s/\n/ /g; |
$contrib=~s/\'/\&\#39\;/g; |
$contrib=~s/\'/\&\#39\;/g; |
Line 163 sub handler {
|
Line 162 sub handler {
|
$color=substr($color,0,6); |
$color=substr($color,0,6); |
my $timestamp=localtime($msgtime); |
my $timestamp=localtime($msgtime); |
my ($mhour,$mmin,$msec)=($timestamp=~/(\d\d)\:(\d\d)\:(\d\d)/); |
my ($mhour,$mmin,$msec)=($timestamp=~/(\d\d)\:(\d\d)\:(\d\d)/); |
$newstuff.='<font color="#'.$color.'"><a name="LC_'.$id.'"></a><b>'. |
$newstuff.='<span style="color:#'.$color.'"><a name="LC_'.$id.'"></a><b>'. |
$sender.'</b> ('.$mhour.':'.$mmin.':'.$msec.'): '. |
$sender.'</b> ('.$mhour.':'.$mmin.':'.$msec.'): '. |
$contrib."</font><br />"; |
$contrib."</span><br />"; |
$bottomid='LC_'.$id; |
$bottomid='LC_'.$id; |
} else { |
} else { |
$entry=~/^(\w+)/; |
$entry=~/^(\w+)/; |
Line 178 sub handler {
|
Line 177 sub handler {
|
$refresh_cmd .= "&group=$group"; |
$refresh_cmd .= "&group=$group"; |
} |
} |
my $headarg; |
my $headarg; |
my ($blocked,$blocktext) = &blockstatus(); |
my $clientip = &Apache::lonnet::get_requestor_ip($r); |
|
my ($blocked,$blocktext) = &blockstatus($clientip); |
if ($blocked) { |
if ($blocked) { |
$newstuff = $blocktext; |
$newstuff = $blocktext; |
$headarg = {'only_body' => 1,}; |
$headarg = {'only_body' => 1,}; |
|
|
|
$r->print(<<ENDSCRIPT); |
|
<script type="text/javascript"> |
|
parent.location.href="/adm/blockingstatus/?activity=chat" |
|
</script> |
|
ENDSCRIPT |
} else { |
} else { |
$headarg = {'redirect' => [5,$refresh_cmd,1], |
$headarg = {'redirect' => [5,$refresh_cmd,1], |
'only_body' => 1,}; |
'only_body' => 1,}; |
Line 217 sub get_seeid_status {
|
Line 223 sub get_seeid_status {
|
} |
} |
|
|
sub blockstatus { |
sub blockstatus { |
|
my ($clientip) = @_; |
my ($blocked,$output); |
my ($blocked,$output); |
my %setters; |
my %setters; |
my ($startblock,$endblock) = &Apache::loncommon::blockcheck(\%setters,'chat'); |
my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) = |
|
&Apache::loncommon::blockcheck(\%setters,'chat',$clientip); |
if ($startblock && $endblock) { |
if ($startblock && $endblock) { |
$blocked = 1; |
$blocked = 1; |
my $endblocktime = &Apache::lonlocal::locallocaltime($endblock); |
my $endblocktime = &Apache::lonlocal::locallocaltime($endblock); |
$output .= &mt('Chat Room will be unavailable to you until [_1] because communication is blocked in one or more of your courses: <br /><br />',$endblocktime); |
$output .= &mt('Chat Room will be unavailable to you until [_1] because communication is blocked in one or more of your courses:',$endblocktime).'<br /><br />'; |
foreach my $course (keys(%setters)) { |
foreach my $course (keys(%setters)) { |
my %courseinfo=&Apache::lonnet::coursedescription($course); |
my %courseinfo=&Apache::lonnet::coursedescription($course); |
for (my $i=0; $i<@{$setters{$course}{staff}}; $i++) { |
for (my $i=0; $i<@{$setters{$course}{staff}}; $i++) { |
Line 232 sub blockstatus {
|
Line 240 sub blockstatus {
|
my ($openblock,$closeblock) = @{$setters{$course}{times}[$i]}; |
my ($openblock,$closeblock) = @{$setters{$course}{times}[$i]}; |
$openblock = &Apache::lonlocal::locallocaltime($openblock); |
$openblock = &Apache::lonlocal::locallocaltime($openblock); |
$closeblock= &Apache::lonlocal::locallocaltime($closeblock); |
$closeblock= &Apache::lonlocal::locallocaltime($closeblock); |
$output .= &mt('Block for [_1] starts: [_2], ends [_3], set by: [_4]<br />',$courseinfo{'description'},$openblock,$closeblock,$fullname); |
$output .= &mt('Block for [_1] starts: [_2], ends [_3], set by: [_4]',$courseinfo{'description'},$openblock,$closeblock,$fullname).'<br />'; |
} |
} |
} |
} |
|
} elsif ($by_ip) { |
|
$blocked = 1; |
|
my $showdom = &Apache::lonnet::domain($blockdom); |
|
if ($showdom eq '') { |
|
$showdom = $blockdom; |
|
} |
|
$output = &mt('Chat Room is unavailable from your current IP address: [_1], ' |
|
.'because communication is blocked for certain IP address(es).' |
|
,$clientip). |
|
'<br />'. |
|
&mt('This restriction was set by an administrator in the [_1] LON-CAPA domain.' |
|
,$showdom); |
} |
} |
return ($blocked,$output); |
return ($blocked,$output); |
} |
} |