<?php define('_VALID_MOS', 1); require_once '/home1/ctcweb9/public_html/includes/alastair.php'; require_once '/home1/ctcweb9/public_html/mailchimp/moderation.config.php'; GetLogonDetails($con, $username); $dirs = array(ModerationConfig::GetInboxDir() . "/cur", ModerationConfig::GetInboxDir() . "/new", ModerationConfig::GetUnmoderatedDir() . "/cur", ModerationConfig::GetUnmoderatedDir() . "/new", ModerationConfig::GetModeratedDir() . "/cur", ModerationConfig::GetModeratedDir() . "/new"); foreach ($dirs as $dir) { $files = scandir($dir); foreach ($files as $file) { if (is_dir("{$dir}/{$file}")) { continue; } echo "deleting {$dir}/{$file}</br>"; unlink("{$dir}/{$file}"); } } $dir = "/home1/ctcweb9/public_html/mailchimp/TestEmails"; $files = scandir($dir); foreach ($files as $file) { if (is_dir("{$dir}/{$file}")) { continue; } echo "copying {$dir}/{$file} to " . ModerationConfig::GetInboxDir() . "/cur/{$file}</br>"; file_put_contents(ModerationConfig::GetInboxDir() . "/cur/{$file}", file_get_contents("{$dir}/{$file}")); }
require_once 'mailchimp.inc.php'; $getpost = $_GET["action"] == null ? $_POST : $_GET; //var_dump($getpost); $isImg = intval($getpost["img"]) == 1; $action = strval($getpost["action"]); $prevaction = strval($getpost["prevaction"]); $msgid = strval($getpost["msgid"]); $ctcid = strval($getpost["ctcid"]); $modid = strval($getpost["modid"]); $listid = strval($getpost["listid"]); $editedsubject = strval($getpost["editedsubject"]); $editedbody = strval($getpost["editedbody"]); $editedfrom = strval($getpost["editedfrom"]); if (!$isImg) { // Do this now before anything gets changed GetLogonDetails($con, $username, $params, "role = " . SqlVal(ModerationConfig::ModeratorRoleName)); } $unmoderateddir = ModerationConfig::GetUnmoderatedDir() . "/cur/{$msgid},*"; $moderateddir = ModerationConfig::GetModeratedDir() . "/cur/{$msgid},*"; $files = array_merge(glob($unmoderateddir), glob($moderateddir)); $location = count($files) == 0 ? null : (strpos($files[0], ModerationConfig::GetUnmoderatedDir()) === 0 ? "unmoderated" : (strpos($files[0], ModerationConfig::GetModeratedDir()) === 0 ? "moderated" : null)); if ($location != null) { $raw = file_get_contents($files[0]); $msg = new PlancakeEmailParser($raw); //var_dump($ctcid, $msg); $ctcaction = $msg->getHeader("ctc-action"); $msg = $msg == null || $ctcid != $msg->getHeader("ctc-id") ? null : $msg; } if ($listid != "") { $query = SqlResultArray($con, "select listname from ctcweb9_ctc.mailchimp_lists where listid = '{$listid}'"); $listname = $query[0]["listname"];