version 1.96, 2019/07/23 13:58:53
|
version 1.106, 2024/07/15 17:12:40
|
Line 68 sub handler {
|
Line 68 sub handler {
|
} |
} |
my $origurl = $env{'form.origurl'}; |
my $origurl = $env{'form.origurl'}; |
if ($origurl =~ m{^https?://[^/]+(.*)$}) { |
if ($origurl =~ m{^https?://[^/]+(.*)$}) { |
$origurl =~ $1; |
$origurl = $1; |
} |
} |
$origurl =~ s/(`)//g; |
$origurl =~ s/(`)//g; |
$origurl =~ s/\$/\(\$\)/g; |
$origurl =~ s/\$/\(\$\)/g; |
Line 319 $jscript
|
Line 319 $jscript
|
$loaditems |
$loaditems |
// ]]> |
// ]]> |
</script> |
</script> |
<script type="text/javascript" src="/res/adm/includes/file_upload.js"></script> |
|
ENDJS |
ENDJS |
if ($recaptcha_version >=2) { |
if ($knownuser) { |
|
$js .="\n".'<script type="text/javascript" src="/res/adm/includes/file_upload.js"></script>'; |
|
} elsif ($recaptcha_version >=2) { |
$js.= "\n".'<script src="https://www.google.com/recaptcha/api.js"></script>'."\n"; |
$js.= "\n".'<script src="https://www.google.com/recaptcha/api.js"></script>'."\n"; |
} |
} |
my %add_entries = ( |
my %add_entries = ( |
Line 390 ENDJS
|
Line 391 ENDJS
|
$i = $num%2; |
$i = $num%2; |
if ($knownuser) { |
if ($knownuser) { |
if ($homeserver) { |
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]). |
$output .= &Apache::lonhtmlcommon::row_title($html_lt{'emac'},undef,$css[$i]). |
'<input type="text" size="50" name="cc" value="" /><br />'."\n". |
'<input type="text" size="50" name="cc" value="" /><br />'."\n". |
&Apache::lonhtmlcommon::row_closure(); |
&Apache::lonhtmlcommon::row_closure(); |
Line 461 ENDJS
|
Line 466 ENDJS
|
my $numtitles = @codetitles; |
my $numtitles = @codetitles; |
if ($numtitles == 0) { |
if ($numtitles == 0) { |
$output .= $html_lt{'enin'}.': |
$output .= $html_lt{'enin'}.': |
<input type="text" name="coursecode" size="15" value="" />'."\n"; |
<input type="text" name="coursecode" size="15" value="'.&HTML::Entities::encode($ccode,'\'"&<>').'" />'."\n"; |
} else { |
} else { |
my @standardnames = &Apache::loncommon::get_standard_codeitems(); |
my @standardnames = &Apache::loncommon::get_standard_codeitems(); |
my $lasttitle = $numtitles; |
my $lasttitle = $numtitles; |
Line 582 ENDJS
|
Line 587 ENDJS
|
} |
} |
$showmax = ' ('.sprintf("%.2f",$showmax).' '.&mt('MB max.').')'; |
$showmax = ' ('.sprintf("%.2f",$showmax).' '.&mt('MB max.').')'; |
$output .= &Apache::lonhtmlcommon::row_title($html_lt{'opfi'},undef,$css[$i]) |
$output .= &Apache::lonhtmlcommon::row_title($html_lt{'opfi'},undef,$css[$i]) |
.' <input type="file" name="screenshot" class="flUpload" size="20" />' |
.' <input type="file" name="screenshot" class="LC_flUpload" size="20" />' |
.'<input type="hidden" id="free_space" value="'.$max.'" />' |
.'<input type="hidden" id="LC_free_space" value="'.$max.'" />' |
.'<br />'."\n".$html_lt{'uplf'}.$showmax."\n" |
.'<br />'."\n".$html_lt{'uplf'}.$showmax."\n" |
.&Apache::lonhtmlcommon::row_closure(); |
.&Apache::lonhtmlcommon::row_closure(); |
$num ++; |
$num ++; |
Line 662 sub print_request_receipt {
|
Line 667 sub print_request_receipt {
|
return; |
return; |
} |
} |
} |
} |
my @ENVvars = ('HTTP_HOST','HTTP_USER_AGENT','REMOTE_ADDR','SERVER_ADDR','SERVER_NAME'); |
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 @envvars = ('browser.os','browser.type','browser.version','user.home','request.role'); |
my @loncvars = ('user.name','user.domain','request.course.sec','request.course.id'); |
my @loncvars = ('user.name','user.domain','request.course.sec','request.course.id'); |
my @cookievars; |
my @cookievars; |
Line 707 sub print_request_receipt {
|
Line 716 sub print_request_receipt {
|
unless (($helpform{'course'} eq 'no') || ($env{'request.lti.login'})) { |
unless (($helpform{'course'} eq 'no') || ($env{'request.lti.login'})) { |
$formvars{'course'} = 1; |
$formvars{'course'} = 1; |
} |
} |
unless ($helpform{'cc'} eq 'no') { |
unless (($helpform{'cc'} eq 'no') || ($by_ip)) { |
$formvars{'cc'} = 1; |
$formvars{'cc'} = 1; |
} |
} |
unless ($helpform{'screenshot'} eq 'no') { |
unless ($helpform{'screenshot'} eq 'no') { |
Line 753 sub print_request_receipt {
|
Line 762 sub print_request_receipt {
|
secn => 'Section', |
secn => 'Section', |
warn => 'Warning: Problem with support e-mail address', |
warn => 'Warning: Problem with support e-mail address', |
your => 'Your support request contained the following information', |
your => 'Your support request contained the following information', |
|
belo => 'Below is your support request which could not be sent', |
|
ifyk => 'If you know an IT support address for your institution, you could copy this information and send it to that email address.', |
sect => 'section', |
sect => 'section', |
info => 'Information supplied', |
info => 'Information supplied', |
adin => 'Additional information recorded', |
adin => 'Additional information recorded', |
Line 981 END
|
Line 992 END
|
|
|
my $message; |
my $message; |
if (!$bad_email) { |
if (!$bad_email) { |
$message = &Apache::lonhtmlcommon::confirm_success( |
$message = &mt('A support request has been sent to [_1]','<tt>'.$to.'</tt>'); |
&mt('A support request has been sent to [_1]','<tt>'.$to.'</tt>')); |
|
} else { |
} else { |
$message = &Apache::lonhtmlcommon::confirm_success( |
$message = $lt{'warn'}.'<br />'; |
$lt{'warn'}.'<br />' |
if ($to eq '') { |
.&mt('As the e-mail address provided for this LON-CAPA server ([_1]) does not appear to be a valid e-mail address, your support request has [_2]not[_3] been sent to the LON-CAPA support staff or administrator at your institution.','<tt>'.$to.'</tt>','<b>','</b>') |
$message .= &mt('For this LON-CAPA server no e-mail address has been configured to receive support requests, so your support request has [_1]not[_2] been sent to the LON-CAPA support staff or administrator at your institution.','<b>','</b>'); |
.' '.&mt('Instead a copy has been sent to the LON-CAPA support team at Michigan State University.'),1); |
} else { |
$to = 'helpdesk@lon-capa.org'; |
$message .= &mt('As the e-mail address provided for this LON-CAPA server ([_1]) does not appear to be a valid e-mail address, your support request has [_2]not[_3] been sent to the LON-CAPA support staff or administrator at your institution.','<tt>'.$to.'</tt>','<b>','</b>'); |
|
} |
} |
} |
$r->print(&Apache::loncommon::confirmwrapper($message)); |
$r->print(&Apache::loncommon::confirmwrapper(&Apache::lonhtmlcommon::confirm_success($message,$bad_email))); |
|
|
if ($reqemail ne '') { |
if ($reqemail ne '') { |
$from = $reqemail; |
$from = $reqemail; |
Line 1071 END
|
Line 1082 END
|
foreach my $var(@ENVvars) { |
foreach my $var(@ENVvars) { |
$supportmsg .= "$var: $ENV{$var}\n"; |
$supportmsg .= "$var: $ENV{$var}\n"; |
} |
} |
|
$supportmsg .= "REMOTE_ADDR: $ip\n"; |
foreach my $var (@envvars) { |
foreach my $var (@envvars) { |
$supportmsg .= "$var: $env{$var}\n"; |
$supportmsg .= "$var: $env{$var}\n"; |
} |
} |
Line 1094 END
|
Line 1106 END
|
foreach my $var (@ENVvars) { |
foreach my $var (@ENVvars) { |
$attachment_text .= "$var: $ENV{$var}\n"; |
$attachment_text .= "$var: $ENV{$var}\n"; |
} |
} |
|
$attachment_text .= "REMOTE_ADDR: $ip\n"; |
foreach my $var (@envvars) { |
foreach my $var (@envvars) { |
$attachment_text .= "$var: $env{$var}\n"; |
$attachment_text .= "$var: $env{$var}\n"; |
} |
} |
Line 1115 END
|
Line 1128 END
|
} |
} |
} |
} |
|
|
# Compose and send a MIME email |
if ($bad_email) { |
&Apache::loncommon::mime_email($from, $to, $subject, $supportmsg, $cc_string, $bcc, |
$r->print('<b>'.$lt{'belo'}.'</b><br />'. |
$attachmentpath, $fname, $attachment_text); |
$lt{'ifyk'}.'<br /><br />'."\n"); |
|
} else { |
|
# Compose and send a MIME email |
|
&Apache::loncommon::mime_email($from,'',$to,$subject,$supportmsg,$cc_string, |
|
$bcc,$attachmentpath,$fname,$attachment_text); |
|
$r->print('<b>'.$lt{'your'}.'</b>:<br /><br />'."\n"); |
|
} |
if ($attachmentpath =~ m|$Apache::lonnet::perlvar{'lonDaemons'}/tmp/helprequests/(\d+)/[^/]+|) { |
if ($attachmentpath =~ m|$Apache::lonnet::perlvar{'lonDaemons'}/tmp/helprequests/(\d+)/[^/]+|) { |
unlink($attachmentpath); |
unlink($attachmentpath); |
} |
} |
$r->print('<b>'.$lt{'your'}.'</b>:<br /><br />'."\n"); |
|
$r->print('<div style="width:620px;">'. |
$r->print('<div style="width:620px;">'. |
&Apache::lonhtmlcommon::start_pick_box(). |
&Apache::lonhtmlcommon::start_pick_box(). |
&Apache::lonhtmlcommon::row_title($lt{'info'},undef,'LC_oddrow_value')."\n".$displaymsg."\n". |
&Apache::lonhtmlcommon::row_title($lt{'info'},undef,'LC_oddrow_value')."\n".$displaymsg."\n". |
Line 1141 END
|
Line 1158 END
|
$var.'</span>: '.$ENV{$var}.', '; |
$var.'</span>: '.$ENV{$var}.', '; |
} |
} |
} |
} |
|
if ($ip ne '') { |
|
$envmsg .= '<span class="LC_helpform_receipt_cat">'. |
|
'REMOTE_ADDR</span>: '.$ip.', '; |
|
} |
foreach my $var (@envvars) { |
foreach my $var (@envvars) { |
if ($env{$var} ne '') { |
if ($env{$var} ne '') { |
$envmsg .= '<span class="LC_helpform_receipt_cat">'. |
$envmsg .= '<span class="LC_helpform_receipt_cat">'. |