if ($db->getNumRows($result) > 0) { while (list($jid, $cid, $mid, $gid, $from_label, $from_email, $subject, $replyto, $unsubscribe, $address, $msg_txt, $msg_html) = $db->fetchQueryRow($result)) { // get the amazon credentials for the campaign creator $res = $db->query("SELECT\r\nXE_AMZ_ACCESS_KEY AS ACCESS_KEY,\r\nXE_AMZ_SECRET_KEY AS SECRET_KEY\r\nFROM XEBURA_AMAZON_CREDENTIALS\r\nWHERE XE_AMZ_MID = '" . $mid . "'"); $row = $db->fetchQueryArray($res); $amz_akey = $row['ACCESS_KEY']; $amz_skey = $row['SECRET_KEY']; // intialize ses class $ses = new SimpleEmailService($amz_akey, $amz_skey); // now for our inner loop, let's find out who we're supposed to send this campaign out to, and loop over them. // need to add check for sending allowed status on email record to this query later // remove LIMIT // update campaign as launched $values = array(XE_CAMPAIGN_STATUS => '2'); // status 2 = launched $db->update("XEBURA_CAMPAIGN", $values, "WHERE XE_CAMPAIGN_ID = '" . $cid . "'"); ////update job as running $start_time = date('Y-m-d G:i:s', strtotime("now")); $values = array(XE_JOB_STATUS => '2', XE_JOB_STARTED_TIME => $start_time); //status 2 = running $db->update("XEBURA_JOBS", $values, "WHERE XE_JOB_ID = '" . $jid . "'"); // START URL REPLACEMENT PART 1 //extract all a tag href= urls to an array $var = $msg_html; preg_match_all("/a[\\s]+[^>]*?href[\\s]?=[\\s\"\\']+" . "(.*?)[\"\\']+.*?>" . "([^<]+|.*?)?<\\/a>/", $var, &$matches); $matches = $matches[1]; $list = array(); $newlinks = array(); //loop over array to insert in to redirect table and use regex to replace URLs foreach ($matches as $var) { // insert var to db and get id number
{ $user_details=explode("|",$val); if($row['USERNAME']==trim($user_details[3])) { header("location:signout.php?signedin=1&user=$row[USERNAME]"); exit; } } }*/ $_SESSION['Username'] = $row['USERNAME']; $_SESSION['Password'] = base64_decode($row['PASSWORD']); $_SESSION['First_Name'] = ucwords($row['FIRSTNAME']) . " " . ucwords($row['LASTNAME']); $_SESSION['Member_Id'] = $mid; $_SESSION['Account_Id'] = $aid; $lastlogin = array(LAST_LOGIN => date('Y-m-d'), LOGIN_TIME => date('H:i:s')); $db->update("xebura_MEMBERS", $lastlogin, " where MID='" . $mid . "' "); include "online.php"; $_SESSION['Nav_Menu'] = "Home"; $encoded_id = encode($mid); //if account info is flagged for update or payment method is declined, etc. if ($row['NEED_UPDATE'] == 1) { $page = "https://somepage"; } else { if ($row['IS_TEMP_PASSWORD'] == 1) { // if password change is required $_SESSION['Nav_Submenu'] = "ChangePassword"; //unset($_SESSION['Nav_Submenu']); //$_SESSION['Redirected_To_Ch'] = 1; $page = 'newchangepassword.php'; } else { if ($row['LOGIN_STATUS'] == 0) {
// www.xebura.com // hello@xebura.com //============================================================+ // This script unsubscribes ppl.... // it needs a UI require 'class/dbclass.php'; include_once 'include/config.php'; require 'include/ses.php'; date_default_timezone_set('America/Los_Angeles'); $db = new mysqldb(); $now = date('Y-m-d G:i:s', strtotime("now")); $ip = $_SERVER['REMOTE_ADDR']; $eid = $_REQUEST['i']; $cid = $_REQUEST['s']; $mid = $db->select_single_value("XEBURA_CAMPAIGN", "XE_CAMPAIGN_MID", "WHERE XE_CAMPAIGN_ID = '" . $cid . "'"); // before we try to unsub the email id, let's check if it is already unsubscribed $sql = "SELECT * FROM XEBURA_MASTER_LIST WHERE XE_ADDRESS_ID = '" . $eid . "' AND XE_ADDRESS_OPT_STATUS = '2'"; $db->query($sql); $result = $db->query($sql); if ($db->getNumRows($result) > 0) { echo "You are already unsubscribed from this list. If you're still receiving emails from this sender, please contact our consumer relations team at abuse@xebura.com"; } else { // unsubscribe the email address from the master list $values = array(XE_ADDRESS_OPT_STATUS => '2'); $db->update("XEBURA_MASTER_LIST", $values, "WHERE XE_ADDRESS_ID = '" . $eid . "'"); //echo "Step 1 - Unsubscribe from Master List - DONE |"; // log the event to the statistics table $values = array(XE_STAT_CAMPAIGN_ID => $cid, XE_STAT_MID => $mid, XE_STAT_EMAIL_ID => $eid, XE_STAT_TYPE => '4', XE_STAT_IP => $ip, XE_STAT_TIMESTAMP => $now); $stat = $db->insert("XEBURA_STATISTICS", $values); echo "You have been unsubscribed from this list successfully and will no longer receive email from this sender."; }