version 1.79.2.3, 2017/01/23 19:57:30
|
version 1.89, 2017/01/23 19:49:07
|
Line 29
|
Line 29
|
package Apache::lonsupportreq; |
package Apache::lonsupportreq; |
|
|
use strict; |
use strict; |
use MIME::Types; |
|
use MIME::Lite; |
|
use CGI::Cookie(); |
use CGI::Cookie(); |
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
use Apache::loncommon(); |
use Apache::loncommon(); |
Line 315 $jscript
|
Line 313 $jscript
|
$loaditems |
$loaditems |
// ]]> |
// ]]> |
</script> |
</script> |
|
<script type="text/javascript" src="/res/adm/includes/file_upload.js"></script> |
ENDJS |
ENDJS |
if ($recaptcha_version >=2) { |
if ($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"; |
Line 574 ENDJS
|
Line 573 ENDJS
|
$showmax = $helpform{'maxsize'}; |
$showmax = $helpform{'maxsize'}; |
} |
} |
$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" size="20" /><br />'. |
.' <input type="file" name="screenshot" class="flUpload" size="20" />' |
"\n".$html_lt{'uplf'}.$showmax."\n". |
.'<input type="hidden" id="free_space" value="'.$max.'" />' |
&Apache::lonhtmlcommon::row_closure(); |
.'<br />'."\n".$html_lt{'uplf'}.$showmax."\n" |
|
.&Apache::lonhtmlcommon::row_closure(); |
$num ++; |
$num ++; |
$i = $num%2; |
$i = $num%2; |
} |
} |
Line 1018 END
|
Line 1018 END
|
} |
} |
} |
} |
|
|
my $attachment_text = ''; |
my $attachment_text; |
unless ($homeserver && $attachmentpath) { |
unless ($homeserver && $attachmentpath) { |
|
my $envdata = ''; |
foreach my $var (@cookievars) { |
foreach my $var (@cookievars) { |
$attachment_text .= "$var: $cookies{$var}\n"; |
$envdata .= "$var: $cookies{$var}\n"; |
} |
} |
foreach my $var (@ENVvars) { |
foreach my $var (@ENVvars) { |
$attachment_text .= "$var: $ENV{$var}\n"; |
$envdata .= "$var: $ENV{$var}\n"; |
} |
} |
foreach my $var (@envvars) { |
foreach my $var (@envvars) { |
$attachment_text .= "$var: $env{$var}\n"; |
$envdata .= "$var: $env{$var}\n"; |
} |
} |
foreach my $var (@loncvars) { |
foreach my $var (@loncvars) { |
$attachment_text .= "$var: $env{$var}\n"; |
$envdata .= "$var: $env{$var}\n"; |
} |
} |
|
$attachment_text = $envdata; |
} |
} |
|
|
if ($addtext) { |
if ($addtext) { |
Line 1044 END
|
Line 1046 END
|
} |
} |
} |
} |
|
|
my $msg = MIME::Lite->new( |
# Compose and send a MIME email |
From => $from, |
&Apache::loncommon::mime_email($from, $to, $subject, $supportmsg, $cc_string, $bcc, |
To => $to, |
$attachmentpath, $fname, $attachment_text); |
Subject => $subject, |
|
Type =>'TEXT', |
|
Data => $supportmsg, |
|
); |
|
if ($homeserver) { |
|
if (@ok_ccs > 0) { |
|
my $cc_string = join(', ',@ok_ccs); |
|
$msg->add("Cc" => $cc_string); |
|
} |
|
} |
|
if ($bcc ne '') { |
|
$msg->add("Bcc" => $bcc); |
|
} |
|
$msg->attr("content-type" => "text/plain"); |
|
$msg->attr("content-type.charset" => "UTF-8"); |
|
|
|
if ($homeserver && $attachmentpath) { |
|
my ($type, $encoding) = MIME::Types::by_suffix($attachmentpath); |
|
$msg->attach(Type => $type, |
|
Path => $attachmentpath, |
|
Filename => $fname |
|
); |
|
|
|
} elsif ($attachment_text ne '') { |
|
$msg->attach(Type => 'TEXT', |
|
Data => $attachment_text); |
|
} |
|
|
|
### Send it: |
|
$msg->send('sendmail'); |
|
|
|
if ($attachmentpath =~ m|$Apache::lonnet::perlvar{'lonDaemons'}/tmp/helprequests/(\d+)/[^/]+|) { |
if ($attachmentpath =~ m|$Apache::lonnet::perlvar{'lonDaemons'}/tmp/helprequests/(\d+)/[^/]+|) { |
unlink($attachmentpath); |
unlink($attachmentpath); |