--- loncom/interface/lonsupportreq.pm 2020/12/18 15:23:02 1.101
+++ loncom/interface/lonsupportreq.pm 2023/07/26 01:03:58 1.105
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Helpdesk request form
#
-# $Id: lonsupportreq.pm,v 1.101 2020/12/18 15:23:02 raeburn Exp $
+# $Id: lonsupportreq.pm,v 1.105 2023/07/26 01:03:58 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -68,7 +68,7 @@ sub handler {
}
my $origurl = $env{'form.origurl'};
if ($origurl =~ m{^https?://[^/]+(.*)$}) {
- $origurl =~ $1;
+ $origurl = $1;
}
$origurl =~ s/(`)//g;
$origurl =~ s/\$/\(\$\)/g;
@@ -391,7 +391,11 @@ ENDJS
$i = $num%2;
if ($knownuser) {
if ($homeserver) {
- unless ($helpform{'cc'} eq 'no') {
+ my $ip = &Apache::lonnet::get_requestor_ip($r);
+ my %setters;
+ my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) =
+ &Apache::loncommon::blockcheck(\%setters,'com',$ip);
+ unless (($helpform{'cc'} eq 'no') || ($by_ip)) {
$output .= &Apache::lonhtmlcommon::row_title($html_lt{'emac'},undef,$css[$i]).
'
'."\n".
&Apache::lonhtmlcommon::row_closure();
@@ -462,7 +466,7 @@ ENDJS
my $numtitles = @codetitles;
if ($numtitles == 0) {
$output .= $html_lt{'enin'}.':
- '."\n";
+ ').'" />'."\n";
} else {
my @standardnames = &Apache::loncommon::get_standard_codeitems();
my $lasttitle = $numtitles;
@@ -663,7 +667,10 @@ sub print_request_receipt {
return;
}
}
- my $ip = &Apache::lonnet::get_requestor_ip();
+ my $ip = &Apache::lonnet::get_requestor_ip($r);
+ my %setters;
+ my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) =
+ &Apache::loncommon::blockcheck(\%setters,'com',$ip);
my @ENVvars = ('HTTP_HOST','HTTP_USER_AGENT','SERVER_ADDR','SERVER_NAME');
my @envvars = ('browser.os','browser.type','browser.version','user.home','request.role');
my @loncvars = ('user.name','user.domain','request.course.sec','request.course.id');
@@ -709,7 +716,7 @@ sub print_request_receipt {
unless (($helpform{'course'} eq 'no') || ($env{'request.lti.login'})) {
$formvars{'course'} = 1;
}
- unless ($helpform{'cc'} eq 'no') {
+ unless (($helpform{'cc'} eq 'no') || ($by_ip)) {
$formvars{'cc'} = 1;
}
unless ($helpform{'screenshot'} eq 'no') {
@@ -1147,7 +1154,8 @@ END
}
if ($ip ne '') {
$envmsg .= ''.
- } 'REMOTE_ADDR: '.$ip.', ';
+ 'REMOTE_ADDR: '.$ip.', ';
+ }
foreach my $var (@envvars) {
if ($env{$var} ne '') {
$envmsg .= ''.