version 1.195, 2021/11/30 16:16:14
|
version 1.200, 2023/09/15 22:32:46
|
Line 111 use Apache::loncommunicate;
|
Line 111 use Apache::loncommunicate;
|
use Apache::lonfeedback; |
use Apache::lonfeedback; |
use Apache::lonrss(); |
use Apache::lonrss(); |
use Apache::lonselstudent(); |
use Apache::lonselstudent(); |
|
use Apache::lonenc(); |
use lib '/home/httpd/lib/perl/'; |
use lib '/home/httpd/lib/perl/'; |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
|
|
Line 1351 sub blocked_in_folder {
|
Line 1352 sub blocked_in_folder {
|
sub compout { |
sub compout { |
my ($r,$forwarding,$replying,$broadcast,$replycrit,$folder,$dismode, |
my ($r,$forwarding,$replying,$broadcast,$replycrit,$folder,$dismode, |
$multiforward)=@_; |
$multiforward)=@_; |
|
my $clientip = &Apache::lonnet::get_requestor_ip($r); |
|
my %setters; |
|
my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) = |
|
&Apache::loncommon::blockcheck(\%setters,'com',$clientip); |
|
if ($by_ip) { |
|
my $showdom = &Apache::lonnet::domain($blockdom); |
|
if ($showdom eq '') { |
|
$showdom = $blockdom; |
|
} |
|
$r->print(&Apache::loncommon::start_page('Messages')); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Send and display messages')); |
|
$r->print('<p class="LC_warning">'. |
|
&mt('Sending of LON-CAPA messages is blocked for your current IP address: [_1].',$clientip).'</p>'. |
|
'<ul><li>'. |
|
&mt('Note: communication is being blocked for certain IP address(es).'). |
|
'</li><li>'. |
|
&mt('This restriction was set by an administrator in the [_1] LON-CAPA domain.',$showdom). |
|
'</li></ul>'); |
|
return; |
|
} |
my $suffix=&Apache::lonmsg::foldersuffix($folder); |
my $suffix=&Apache::lonmsg::foldersuffix($folder); |
my ($cdom,$cnum,$group,$refarg); |
my ($cdom,$cnum,$group,$refarg); |
if (exists($env{'form.group'})) { |
if (exists($env{'form.group'})) { |
Line 2483 sub displaymessage {
|
Line 2504 sub displaymessage {
|
$showsymb,$env{'user.domain'},$env{'user.name'}); |
$showsymb,$env{'user.domain'},$env{'user.name'}); |
if ($symb) { |
if ($symb) { |
if ($encrypturl =~ /^yes$/i && !$env{'request.role.adv'}) { |
if ($encrypturl =~ /^yes$/i && !$env{'request.role.adv'}) { |
$showsymb = &Apache::lonenc::check_encrypt($symb); |
unless ($showsymb =~ m{^/enc/}) { |
|
$showsymb = &Apache::lonenc::encrypted($showsymb); |
|
} |
} |
} |
$symblink = '?symb='.$showsymb; |
$symblink = '?symb='.$showsymb; |
} |
} |
if ($encrypturl =~ /^yes$/i && !$env{'request.role.adv'}) { |
if ($encrypturl =~ /^yes$/i && !$env{'request.role.adv'}) { |
$showurl = $baseurl; |
unless ($showurl =~ m{^/enc/}) { |
|
$showurl = &Apache::lonenc::encrypted($showurl); |
|
} |
} |
} |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Refers to')) |
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Refers to')) |
.'<a href="'.$showurl.$symblink.'">'.$restitle.'</a>' |
.'<a href="'.$showurl.$symblink.'">'.$restitle.'</a>' |
Line 2682 sub displayresource {
|
Line 2707 sub displayresource {
|
&& (&Apache::lonnet::allowed('vgr',$content{'courseid'}))) { |
&& (&Apache::lonnet::allowed('vgr',$content{'courseid'}))) { |
my $symb; |
my $symb; |
if (defined($content{'symb'})) { |
if (defined($content{'symb'})) { |
$symb = $content{'symb'}; |
$symb = &Apache::lonenc::check_decrypt($content{'symb'}); |
} else { |
} elsif (defined($content{'baseurl'})) { |
$symb=&Apache::lonnet::symbread($content{'baseurl'}); |
$symb = |
|
&Apache::lonnet::symbread(&Apache::lonenc::check_decrypt($content{'baseurl'})); |
} |
} |
# Could not get a symb, give up |
# Could not get a symb, give up |
unless ($symb) { return $content{'citation'}; } |
unless ($symb) { return $content{'citation'}; } |
Line 2800 sub sendoffmail {
|
Line 2826 sub sendoffmail {
|
$cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
$cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
$cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
$cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
} |
} |
if ($env{'form.send'}) { |
my $clientip = &Apache::lonnet::get_requestor_ip($r); |
|
my %setters; |
|
my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) = |
|
&Apache::loncommon::blockcheck(\%setters,'com',$clientip); |
|
if ($by_ip) { |
|
&printheader($r,'','Sending messages blocked from your location.'); |
|
return 'blocked'; |
|
} elsif ($env{'form.send'}) { |
if (!$env{'form.multiforward'}) { |
if (!$env{'form.multiforward'}) { |
if ($group eq '') { |
if ($group eq '') { |
&printheader($r,'','Messages being sent.'); |
&printheader($r,'','Messages being sent.'); |
Line 3237 sub handler {
|
Line 3270 sub handler {
|
'sendreply','compose','sendmail','critical','recname','recdom', |
'sendreply','compose','sendmail','critical','recname','recdom', |
'recordftf','sortedby','folder','startdis','interdis', |
'recordftf','sortedby','folder','startdis','interdis', |
'showcommentbaseurl','dismode','group','subject','text','ref', |
'showcommentbaseurl','dismode','group','subject','text','ref', |
'msgstatus']); |
'msgstatus','btoken']); |
$sqs='&sortedby='.$env{'form.sortedby'}; |
$sqs='&sortedby='.$env{'form.sortedby'}; |
|
|
|
# ----------- Check if access was from balancer to server with existing session |
|
|
|
if ($env{'form.btoken'}) { |
|
my %info = &Apache::lonnet::tmpget($env{'form.btoken'}); |
|
&Apache::lonnet::tmpdel($env{'form.btoken'}); |
|
delete($env{'form.btoken'}); |
|
unless ($env{'form.display'}) { |
|
if (($info{'display'}) && ($info{'mailrecip'})) { |
|
if (&unescape($info{'mailrecip'}) eq $env{'user.name'}.':'.$env{'user.domain'}) { |
|
$env{'form.display'} = &unescape($info{'display'}); |
|
} |
|
} |
|
} |
|
} |
|
|
# ------------------------------------------------------ They checked for email |
# ------------------------------------------------------ They checked for email |
&Apache::lonnet::put('email_status',{'recnewemail'=>0}); |
&Apache::lonnet::put('email_status',{'recnewemail'=>0}); |
|
|
Line 3494 sub handler {
|
Line 3542 sub handler {
|
my $count = keys(%forwardfail); |
my $count = keys(%forwardfail); |
my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Could not forward [quant,_1,message].',$count),1); |
my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Could not forward [quant,_1,message].',$count),1); |
foreach my $key (keys(%forwardfail)) { |
foreach my $key (keys(%forwardfail)) { |
$message .= '<br />'.&mt('Could not deliver forwarded message.').'</span> '. |
$message .= '<br />'.&mt('Could not deliver forwarded message.').' '; |
&mt('The recipient addresses may need to be corrected').' ('.$forwardfail{$key}.')'; |
if ($forwardfail{$key} eq 'blocked') { |
|
$message .= &mt('Sending messages is blocked from your IP address'); |
|
} else { |
|
$message .= &mt('The recipient addresses may need to be corrected').' ('.$forwardfail{$key}.')'; |
|
} |
} |
} |
$message = &Apache::loncommon::confirmwrapper($message); |
$message = &Apache::loncommon::confirmwrapper($message); |
$r->print($message); |
$r->print($message); |