52 lines
1.2 KiB
PHP
52 lines
1.2 KiB
PHP
<?php
|
|
$ValidAccess = 2010;
|
|
$sessionName = 'hotlunch';
|
|
session_name($sessionName);
|
|
session_start();
|
|
require_once("include/globals.php");
|
|
|
|
|
|
if (SessionActive() != 1 || ! UserLoggedIn()) {
|
|
logExit("Session is not active",$moduleName);
|
|
exit;
|
|
}
|
|
|
|
|
|
$moduleName = "ajax.SendQueuedEmail.php";
|
|
// startLog($moduleName);
|
|
|
|
// CSRF token validation
|
|
include "include/ajax.csrfToken.php";
|
|
|
|
|
|
// Set default timezone
|
|
date_default_timezone_set("Canada/Pacific");
|
|
$now = date("Y-m-d H:i:s",time());
|
|
|
|
$return_data = array();
|
|
|
|
|
|
// Get parameters
|
|
$email_to = db_escape_string($_GET['email_to']);
|
|
$email_from = db_escape_string($_GET['email_from']);
|
|
$email_subject = db_escape_string($_GET['email_subject']);
|
|
$email_message = db_escape_string($_GET['email_message']);
|
|
$email_from_name = db_escape_string($_GET['email_from_name']);
|
|
$email_to_name = db_escape_string($_GET['email_to_name']);
|
|
$attachments = db_escape_string($_GET['attachments']);
|
|
$template_file = db_escape_string($_GET['template_file']);
|
|
|
|
writeLog("email_to: $email_to");
|
|
writeLog("email_subject: $email_subject");
|
|
|
|
// Convert attachments to an array
|
|
if (isstring($attachments) && strlen($attachments)) {
|
|
$files = explode("\n",$attachments);
|
|
$attachments = $files;
|
|
}
|
|
else {
|
|
$attachments = array();
|
|
}
|
|
|
|
?>
|