Changeset:
e9d3df213e27
https://sourceforge.net/p/mrbs/hg-code/ci/e9d3df213e274bfebce3c0ab6a83b26d2d7cb195
Author:
Campbell Morrison <[email protected]>
Date:
Wed Sep 14 13:25:31 2016 +0100
Log message:
Fixed various bugs preventing mail being sent.
diffstat:
web/functions.inc | 9 +++++----
web/functions_mail.inc | 8 ++++----
web/report.php | 6 +++---
3 files changed, 12 insertions(+), 11 deletions(-)
diffs (84 lines):
diff -r b0d01bc931b6 -r e9d3df213e27 web/functions.inc
--- a/web/functions.inc Wed Sep 14 13:12:09 2016 +0100
+++ b/web/functions.inc Wed Sep 14 13:25:31 2016 +0100
@@ -324,10 +324,11 @@
$periods_per_day = count($periods);
// Need to use the MRBS version of DateTime to get round a bug in modify()
- // in PHP before 5.3.6
- $startDate = new MRBS\DateTime();
+ // in PHP before 5.3.6. As we are in the MRBS namespace we will get the
+ // MRBS version.
+ $startDate = new DateTime();
$startDate->setTimestamp($start_time);
- $endDate = new MRBS\DateTime();
+ $endDate = new DateTime();
$endDate->setTimestamp($end_time);
// Set both dates to noon so that we can compare them and get an integral
@@ -2044,7 +2045,7 @@
function validate_email($email)
{
- return PHPMailer::validateAddress($email);
+ return \PHPMailer::validateAddress($email);
}
diff -r b0d01bc931b6 -r e9d3df213e27 web/functions_mail.inc
--- a/web/functions_mail.inc Wed Sep 14 13:12:09 2016 +0100
+++ b/web/functions_mail.inc Wed Sep 14 13:25:31 2016 +0100
@@ -187,7 +187,7 @@
$array[$i] = trim($array[$i]);
if ($array[$i] !== '')
{
- $mailer = new PHPMailer;
+ $mailer = new \PHPMailer;
// Use parseAddresses() to validate the address because it could contain
a display name
if (count($mailer->parseAddresses($array[$i])) == 0)
{
@@ -1125,7 +1125,7 @@
global $mail_settings, $sendmail_settings, $smtp_settings, $enable_periods;
- $mail = new PHPMailer;
+ $mail = new \PHPMailer;
mail_debug("Preparing to send email ...");
if ($mail_settings['debug'])
@@ -1260,7 +1260,7 @@
$mime_params = array();
$mime_params['eol'] = $eol;
$mime_params['content_type'] = "multipart/alternative";
- $mime_inner = new Mail_mimePart('', $mime_params);
+ $mime_inner = new \Mail_mimePart('', $mime_params);
// Add the text part
$mime_params['content_type'] = "text/plain";
@@ -1297,7 +1297,7 @@
$mime_params = array();
$mime_params['eol'] = $eol;
$mime_params['content_type'] = "multipart/mixed";
- $mime = new Mail_mimePart('', $mime_params);
+ $mime = new \Mail_mimePart('', $mime_params);
// Now add the inner section as the first sub part
$mime_inner = $mime_inner->encode();
diff -r b0d01bc931b6 -r e9d3df213e27 web/report.php
--- a/web/report.php Wed Sep 14 13:12:09 2016 +0100
+++ b/web/report.php Wed Sep 14 13:25:31 2016 +0100
@@ -937,11 +937,11 @@
// the last period and midnight
// Need to use the MRBS version of DateTime to get round a bug in modify()
- // in PHP before 5.3.6
- $startDate = new MRBS\DateTime();
+ // in PHP before 5.3.6. As we are in the MRBS namespace we will get the
MRBS version.
+ $startDate = new DateTime();
$startDate->setTimestamp($report_start)->modify('12:00');
- $endDate = new MRBS\DateTime();
+ $endDate = new DateTime();
$endDate->setTimestamp($report_end)->modify('12:00');
$endDate->sub(new DateInterval('P1D')); // Go back one day because the
$report_end is at 00:00 the day after
$endDate->add(new DateInterval('PT' . $periods_per_day . 'M'));
------------------------------------------------------------------------------
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits