Example #1
0
                 $messageStack->add_session($statusMsg, 'error');
                 $order->updateStatus(array('comments' => $statusMsg));
             }
         }
     }
     if (empty($hasError)) {
         if ($order->updateStatus($_REQUEST)) {
             $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
         } else {
             $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
         }
         zen_redirect(zen_href_link_admin(FILENAME_ORDERS, zen_get_all_get_params(array('action')) . 'action=edit', 'SSL'));
     }
     break;
 case 'email':
     if (validate_email_syntax($_REQUEST['email'])) {
         $order->send_order_email($order->mOrdersId, $_REQUEST['email'], $_REQUEST['email_format']);
         $messageStack->add_session('Copy of receipt emailed to ' . $_REQUEST['email'], 'success');
         bit_redirect(BITCOMMERCE_PKG_URL . 'admin/orders.php?action=edit&oID=' . $_REQUEST['oID']);
     }
     break;
 case 'combine':
     if (@BitBase::verifyId($_REQUEST['combine_order_id'])) {
         $combineOrder = new order($_REQUEST['combine_order_id']);
         $combineHash['source_orders_id'] = $_REQUEST['oID'];
         $combineHash['dest_orders_id'] = $_REQUEST['combine_order_id'];
         $combineHash['combine_notify'] = !empty($_REQUEST['combine_notify']);
         if ($combineOrder->combineOrders($combineHash)) {
             bit_redirect(BITCOMMERCE_PKG_URL . 'admin/orders.php?action=edit&oID=' . $_REQUEST['combine_order_id']);
         } else {
             print "<span class='error'>" . $combineOrder->mErrors['combine'] . "</span>";
Example #2
0
function board_sync_delivered_to($raw_headers)
{
    $ret = null;
    if (isset($raw_headers) && preg_match_all("/Delivered-To:\\s*(.*)\\s*/", $raw_headers, $deliveredTo) > 0) {
        $ret = array();
        foreach ($deliveredTo[1] as $address) {
            // Make sure the Delivered-To: address is valid.
            if (validate_email_syntax($address)) {
                $ret[] = strtolower(trim($address));
            }
        }
    }
    return $ret;
}
Example #3
0
 /**
  * changeUserEmail
  *
  * @param array $pUserId
  * @param array $pEmail
  * @access public
  * @return TRUE on success, FALSE on failure - mErrors will contain reason for failure
  */
 function changeUserEmail($pUserId, $pEmail)
 {
     if (!validate_email_syntax($pEmail)) {
         $this->mErrors['bad_mail'] = tra("The email address provided does not have recognised valid syntax.");
     } elseif ($this->userExists(array('email' => $pEmail))) {
         $this->mErrors['duplicate_mail'] = tra("The email address you selected already exists.");
     } else {
         $query = "UPDATE `" . BIT_DB_PREFIX . "users_users` SET `email`=? WHERE `user_id`=?";
         $result = $this->mDb->query($query, array($pEmail, $pUserId));
         $query = "UPDATE `" . BIT_DB_PREFIX . "users_watches` SET `email`=? WHERE `user_id`=?";
         $result = $this->mDb->query($query, array($pEmail, $pUserId));
         // update value in hash
         $this->mInfo['email'] = $pEmail;
     }
     return count($this->mErrors) == 0;
 }