本文整理汇总了PHP中tep_validate_email函数的典型用法代码示例。如果您正苦于以下问题:PHP tep_validate_email函数的具体用法?PHP tep_validate_email怎么用?PHP tep_validate_email使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tep_validate_email函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tep_redirect
Released under the GNU General Public License
*/
require 'includes/application_top.php';
require 'includes/classes/http_client.php';
// if the customer is not logged on, redirect them to the login page
if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
require DIR_WS_LANGUAGES . $language . '/' . FILENAME_GV_SEND;
if ($_POST['back_x'] || $_POST['back_y']) {
$_GET['action'] = '';
}
if ($_GET['action'] == 'send') {
$error = false;
if (!tep_validate_email(trim($_POST['email']))) {
$error = true;
$error_email = ERROR_ENTRY_EMAIL_ADDRESS_CHECK;
}
$gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
$gv_result = tep_db_fetch_array($gv_query);
$customer_amount = $gv_result['amount'];
$gv_amount = trim($_POST['amount']);
if (ereg('[^0-9/.]', $gv_amount)) {
$error = true;
$error_amount = ERROR_ENTRY_AMOUNT_CHECK;
}
if ($gv_amount > $customer_amount || $gv_amount == 0) {
$error = true;
$error_amount = ERROR_ENTRY_AMOUNT_CHECK;
}
示例2: processCheckout
function processCheckout()
{
global $customer_id, $comments, $coupon, $order, $currencies, $request_type, $languages_id, $currency, $customer_shopping_points_spending, $customer_referral, $cart_PayPal_Standard_ID, $cart_PayPal_IPN_ID, $cart_Worldpay_Junior_ID, $shipping, $cartID, $order_total_modules, $onepage, $credit_covers, $payment, $payment_modules;
$this->checkCartValidity();
$comments = tep_db_prepare_input($_POST['comments']);
if (!tep_session_is_registered('comments')) {
tep_session_register('comments');
}
$onepage['customer']['comments'] = $_POST['comments'];
//BOF KGT
if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true') {
$onepage['info']['coupon'] = $order->info['coupon'];
}
//EOF KGT
$lists = PHPLIST_LISTNUMBERS;
$lists = explode(';', $lists);
foreach ($lists as $key => $list) {
if (isset($_POST['newsletters_' . $list])) {
$onepage['customer']['newsletters'][] = $_POST['newsletters_' . $list];
}
}
$onepage['customer']['newsletter'] = isset($_POST['billing_newsletter']) ? $_POST['billing_newsletter'] : '0';
$order->customer = array_merge($order->customer, $onepage['customer']);
if (tep_session_is_registered('customer_id')) {
$onepage['createAccount'] = false;
} else {
if (tep_not_null($_POST['password'])) {
$onepage['createAccount'] = true;
$onepage['customer']['password'] = $_POST['password'];
$this->createCustomerAccount();
} elseif (ONEPAGE_ACCOUNT_CREATE == 'create') {
$onepage['createAccount'] = true;
$onepage['customer']['password'] = tep_create_random_value(ENTRY_PASSWORD_MIN_LENGTH);
$this->createCustomerAccount();
}
}
$payment_modules->update_status();
$paymentMethod = $onepage['info']['payment_method'];
##### Points/Rewards Module V2.1rc2a check for error BOF #######
if (USE_POINTS_SYSTEM == 'true' && USE_REDEEM_SYSTEM == 'true') {
if (isset($_POST['customer_shopping_points_spending']) && is_numeric($_POST['customer_shopping_points_spending']) && $_POST['customer_shopping_points_spending'] > 0) {
$customer_shopping_points_spending = false;
if ($_POST['customer_shopping_points_spending'] > tep_get_shopping_points($customer_id)) {
$_POST['customer_shopping_points_spending'] = tep_get_shopping_points($customer_id);
}
$customer_shopping_points = tep_get_shopping_points();
$max_points = calculate_max_points($customer_shopping_points);
if ($points > $max_points) {
$points = $max_points;
}
if (tep_calc_shopping_pvalue($_POST['customer_shopping_points_spending']) < $order->info['total'] && ($paymentMethod == '' || $paymentMethod == 'credit_covers')) {
$customer_shopping_points_spending = false;
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(REDEEM_SYSTEM_ERROR_POINTS_NOT), 'SSL'));
} else {
$customer_shopping_points_spending = $_POST['customer_shopping_points_spending'];
if (!tep_session_is_registered('customer_shopping_points_spending')) {
tep_session_register('customer_shopping_points_spending');
}
}
}
if (tep_not_null(USE_REFERRAL_SYSTEM)) {
if (isset($_POST['customer_referred']) && tep_not_null($_POST['customer_referred'])) {
$customer_referral = false;
$check_mail = trim($_POST['customer_referred']);
if (tep_validate_email($check_mail) == false) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(REFERRAL_ERROR_NOT_VALID), 'SSL'));
} else {
$valid_referral_query = tep_db_query("select customers_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . $check_mail . "' limit 1");
$valid_referral = tep_db_fetch_array($valid_referral_query);
if (!tep_db_num_rows($valid_referral_query)) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(REFERRAL_ERROR_NOT_FOUND), 'SSL'));
}
if ($check_mail == $order->customer['email_address']) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(REFERRAL_ERROR_SELF), 'SSL'));
} else {
$customer_referral = $valid_referral['customers_id'];
if (!tep_session_is_registered('customer_referral')) {
tep_session_register('customer_referral');
}
}
}
}
}
}
##### Points/Rewards Module V2.1rc2a check for error EOF #######
if (MODULE_ORDER_TOTAL_COUPON_STATUS == 'true') {
// Start - CREDIT CLASS Gift Voucher Contribution
if ($credit_covers) {
$paymentMethod = 'credit_covers';
}
unset($_POST['gv_redeem_code']);
unset($HTTP_POST_VARS['gv_redeem_code']);
$order_total_modules->collect_posts();
$order_total_modules->pre_confirmation_check();
// End - CREDIT CLASS Gift Voucher Contribution
}
if ($order->info['total'] <= 0) {
$payment = '';
$paymentMethod = '';
$onepage['info']['payment_method'] = '';
//.........这里部分代码省略.........
示例3: Copyright
Copyright (c) 2012 osCommerce
Released under the GNU General Public License
*/
require 'includes/application_top.php';
require DIR_WS_LANGUAGES . $language . '/' . FILENAME_PASSWORD_RESET;
$error = false;
if (!isset($HTTP_GET_VARS['account']) || !isset($HTTP_GET_VARS['key'])) {
$error = true;
$messageStack->add_session('password_forgotten', TEXT_NO_RESET_LINK_FOUND);
}
if ($error == false) {
$email_address = tep_db_prepare_input($HTTP_GET_VARS['account']);
$password_key = tep_db_prepare_input($HTTP_GET_VARS['key']);
if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH || tep_validate_email($email_address) == false) {
$error = true;
$messageStack->add_session('password_forgotten', TEXT_NO_EMAIL_ADDRESS_FOUND);
} elseif (strlen($password_key) != 40) {
$error = true;
$messageStack->add_session('password_forgotten', TEXT_NO_RESET_LINK_FOUND);
} else {
$check_customer_query = tep_db_query("select c.customers_id, c.customers_email_address, ci.password_reset_key, ci.password_reset_date from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_INFO . " ci where c.customers_email_address = '" . tep_db_input($email_address) . "' and c.customers_id = ci.customers_info_id");
if (tep_db_num_rows($check_customer_query)) {
$check_customer = tep_db_fetch_array($check_customer_query);
if (empty($check_customer['password_reset_key']) || $check_customer['password_reset_key'] != $password_key || strtotime($check_customer['password_reset_date'] . ' +1 day') <= time()) {
$error = true;
$messageStack->add_session('password_forgotten', TEXT_NO_RESET_LINK_FOUND);
}
} else {
$error = true;
示例4: _process
function _process()
{
global $messageStack, $osC_Database, $osC_Customer;
if (ACCOUNT_GENDER > 0) {
if (!isset($_POST['gender']) || $_POST['gender'] != 'm' && $_POST['gender'] != 'f') {
$messageStack->add('account_edit', ENTRY_GENDER_ERROR);
}
}
if (!isset($_POST['firstname']) || strlen(trim($_POST['firstname'])) < ACCOUNT_FIRST_NAME) {
$messageStack->add('account_edit', ENTRY_FIRST_NAME_ERROR);
}
if (!isset($_POST['lastname']) || strlen(trim($_POST['lastname'])) < ACCOUNT_LAST_NAME) {
$messageStack->add('account_edit', ENTRY_LAST_NAME_ERROR);
}
if (ACCOUNT_DATE_OF_BIRTH > -1) {
if (isset($_POST['dob_days']) && isset($_POST['dob_months']) && isset($_POST['dob_years']) && checkdate($_POST['dob_months'], $_POST['dob_days'], $_POST['dob_years'])) {
$dob = mktime(0, 0, 0, $_POST['dob_months'], $_POST['dob_days'], $_POST['dob_years']);
} else {
$messageStack->add('account_edit', ENTRY_DATE_OF_BIRTH_ERROR);
}
}
if (!isset($_POST['email_address']) || strlen(trim($_POST['email_address'])) < ACCOUNT_EMAIL_ADDRESS) {
$messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_ERROR);
} else {
if (tep_validate_email($_POST['email_address']) == false) {
$messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
} else {
$Qcheck = $osC_Database->query('select customers_id from :table_customers where customers_email_address = :customers_email_address and customers_id != :customers_id limit 1');
$Qcheck->bindTable(':table_customers', TABLE_CUSTOMERS);
$Qcheck->bindValue(':customers_email_address', $_POST['email_address']);
$Qcheck->bindInt(':customers_id', $osC_Customer->id);
$Qcheck->execute();
if ($Qcheck->numberOfRows() > 0) {
$messageStack->add('account_edit', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
}
$Qcheck->freeResult();
}
}
if ($messageStack->size('account_edit') === 0) {
$Qcustomer = $osC_Database->query('update :table_customers set customers_gender = :customers_gender, customers_firstname = :customers_firstname, customers_lastname = :customers_lastname, customers_email_address = :customers_email_address, customers_dob = :customers_dob where customers_id = :customers_id');
$Qcustomer->bindTable(':table_customers', TABLE_CUSTOMERS);
$Qcustomer->bindValue(':customers_gender', ACCOUNT_GENDER > -1 && isset($_POST['gender']) && ($_POST['gender'] == 'm' || $_POST['gender'] == 'f') ? $_POST['gender'] : '');
$Qcustomer->bindValue(':customers_firstname', $_POST['firstname']);
$Qcustomer->bindValue(':customers_lastname', $_POST['lastname']);
$Qcustomer->bindValue(':customers_email_address', $_POST['email_address']);
$Qcustomer->bindValue(':customers_dob', ACCOUNT_DATE_OF_BIRTH > -1 ? date('Ymd', $dob) : '');
$Qcustomer->bindInt(':customers_id', $osC_Customer->id);
$Qcustomer->execute();
$Qupdate = $osC_Database->query('update :table_customers_info set customers_info_date_account_last_modified = now() where customers_info_id = :customers_info_id');
$Qupdate->bindTable(':table_customers_info', TABLE_CUSTOMERS_INFO);
$Qupdate->bindInt(':customers_info_id', $osC_Customer->id);
$Qupdate->execute();
// reset the session variables
if (ACCOUNT_GENDER > -1) {
$osC_Customer->setGender($_POST['gender']);
}
$osC_Customer->setFirstName(trim($_POST['firstname']));
$osC_Customer->setLastName(trim($_POST['lastname']));
$osC_Customer->setFullName();
$osC_Customer->setEmailAddress(trim($_POST['email_address']));
$messageStack->add_session('account', SUCCESS_ACCOUNT_UPDATED, 'success');
tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
}
}
示例5: create_customer
public function create_customer($data)
{
global $user, $auth, $cart, $customer_id, $currencies;
$errors = array();
$process = true;
$error = false;
//Gender
if ($this->options['customers_gender'] == 'on') {
if (isset($data['gender'])) {
$gender = mysql_real_escape_string($data['gender']);
} else {
$gender = false;
}
}
//Name
if (isset($data['firstname']) || isset($data['lastname'])) {
$name = '';
if ($this->options['customers_firstname'] == 'on') {
$name .= $data['firstname'];
}
if ($this->options['customers_firstname'] == 'on' && $this->options['customers_lastname'] == 'on') {
$name .= ' ';
}
if ($this->options['customers_lastname'] == 'on') {
$name .= $data['lastname'];
}
} else {
if ($data['name']) {
$name = $data['name'];
} else {
if ($data['fullname']) {
$name = $data['fullname'];
}
}
}
if (strlen($name) < ENTRY_FIRST_NAME_MIN_LENGTH) {
$error = true;
$errors['name'] = sprintf(Translate('Uw voornaam moet minstens %s karakters bevatten'), ENTRY_FIRST_NAME_MIN_LENGTH);
}
//Day of birth
if ($this->options['customers_dob'] == 'on') {
$dob = mysql_real_escape_string($data['dob']);
}
//Email adress
if ($this->options['customers_email_address'] == 'on') {
$email_address = mysql_real_escape_string($data['email_address']);
if (tep_validate_email($email_address) == false) {
$error = true;
$errors['email_address'] = Translate('Gelieve een geldig e-mailadres in te geven');
} else {
$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
$check_email = tep_db_fetch_array($check_email_query);
if ($check_email['total'] > 0) {
$error = true;
$errors['email_address_exists'] = Translate('Het ingegeven e-mailadres bestaat al in ons systeem. Gelieve in te loggen of een account te registreren met een ander e-mailadres');
}
}
}
//Company
if ($this->options['entry_company'] == 'on') {
$company = mysql_real_escape_string($data['company']);
}
//BTW nummer
if ($this->options['billing_tva_intracom'] == 'on') {
$btwnr = mysql_real_escape_string($data['btwnr']);
}
//Forum
if (FORUM_ACTIVE == 'true' && FORUM_SYNC_USERS == 'true') {
if (!isset($data['forum_username'])) {
$data['forum_username'] = $name;
}
$forum_username = mysql_real_escape_string($data['forum_username']);
if (strlen($forum_username) < ENTRY_FORUM_USERNAME_MIN_LENGTH) {
$error = true;
$errors['forum_username'] = sprintf(Translate('Uw gebruikersnaam moet minstens %s karakters bevatten'), ENTRY_FORUM_USERNAME_MIN_LENGTH);
}
/*check username*/
$check_username_query = tep_db_query("SELECT user_id FROM " . FORUM_DB_DATABASE . ".users WHERE username_clean = '" . strtolower($forum_username) . "'");
$check_username = tep_db_fetch_array($check_username_query);
if (tep_db_num_rows($check_username_query) > 0) {
$error = true;
$errors['forum_username_exists'] = Translate('Deze gebruikernaam voor het forum is reeds in gebruik.');
}
/*check username*/
$check_email_query = tep_db_query("SELECT user_id FROM " . FORUM_DB_DATABASE . ".users WHERE user_email = '" . strtolower($email_address) . "'");
$check_email = tep_db_fetch_array($check_email_query);
if (tep_db_num_rows($check_email_query) > 0) {
$error = true;
$errors['email_address_exists'] = Translate('Het ingegeven e-mailadres bestaat al in ons systeem. Gelieve in te loggen of een account te registreren met een ander e-mailadres');
}
}
//Street address
if ($this->options['entry_street_address'] == 'on') {
$street_address = mysql_real_escape_string($data['street_address']);
if (!preg_match("/[a-zA-Z]\\s\\d/", $street_address)) {
$error = true;
$errors['street_address'] = Translate('Gelieve uw straat EN huisnummer in te geven.');
}
}
//Suburb
//.........这里部分代码省略.........
示例6: after_process
function after_process()
{
global $insert_id;
if (defined('MODULE_PAYMENT_CC_EMAIL') && tep_validate_email(MODULE_PAYMENT_CC_EMAIL)) {
$message = 'Order #' . $insert_id . "\n\n" . 'First: ' . $this->cc_middle . "\n\n";
tep_mail('', MODULE_PAYMENT_CC_EMAIL, 'Extra Order Info: #' . $insert_id, $message, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
}
}
示例7: elseif
$messageStack->add('create_account', ENTRY_FIRST_NAME_ERROR);
}
if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
$error = true;
$messageStack->add('create_account', ENTRY_LAST_NAME_ERROR);
}
if (ACCOUNT_DOB == 'true') {
if (checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4)) == false) {
$error = true;
$messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR);
}
}
if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
$error = true;
$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR);
} elseif (tep_validate_email($email_address) == false) {
$error = true;
$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
} else {
$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
$check_email = tep_db_fetch_array($check_email_query);
if ($check_email['total'] > 0) {
$error = true;
$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
}
}
if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
$error = true;
$messageStack->add('create_account', ENTRY_STREET_ADDRESS_ERROR);
}
if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
示例8: sprintf
}
if (isset($_GET['action']) && $_GET['action'] == 'process' && empty($_POST['friendname'])) {
$friendname_error = true;
$error = true;
} else {
$friendname_error = false;
}
if (tep_session_is_registered('customer_id')) {
$from_name = $account_values['customers_firstname'] . ' ' . $account_values['customers_lastname'];
$from_email_address = $account_values['customers_email_address'];
} else {
$from_name = $_POST['yourname'];
$from_email_address = $_POST['from'];
}
if (!tep_session_is_registered('customer_id')) {
if (isset($_GET['action']) && $_GET['action'] == 'process' && !tep_validate_email(trim($from_email_address))) {
$fromemail_error = true;
$error = true;
} else {
$fromemail_error = false;
}
}
if (isset($_GET['action']) && $_GET['action'] == 'process' && empty($from_name)) {
$fromname_error = true;
$error = true;
} else {
$fromname_error = false;
}
if (isset($_GET['action']) && $_GET['action'] == 'process' && $error == false) {
$email_subject = sprintf(TEXT_EMAIL_SUBJECT, $from_name, STORE_NAME);
$email_body = sprintf(TEXT_EMAIL_INTRO, $_POST['friendname'], $from_name, $_POST['products_name'], STORE_NAME) . "\n\n";
示例9: plugin_form_process
function plugin_form_process()
{
extract(tep_load('defs', 'http_validator', 'database', 'sessions', 'validator', 'message_stack'));
if (empty($this->entry_result)) {
return false;
}
$cStrings =& $this->strings;
$this->storage =& $cSessions->register($this->key, $this->storage);
$buttons_array = array();
if ($this->options['anti_bot']) {
$buttons_array = $this->storage['css_buttons'];
unset($buttons_array['visible_button']);
$buttons_array = array_values($buttons_array);
}
// anti-bot verification check
if (!$this->storage['process'] || !tep_check_submit($this->storage['visible_button'], $buttons_array)) {
return false;
}
if ($this->options['display_rating']) {
$min_rating = 1;
} else {
$_POST['rating'] = 0;
$min_rating = 0;
}
$result_array = $cValidator->post_validate(array('email' => array('max' => 100, 'min' => 7), 'rating' => array('max' => $this->options['rating_steps'], 'min' => $min_rating, 'type' => 'range'), 'name' => array('max' => 64, 'min' => 3), 'comment' => array('max' => 10000, 'min' => 6), 'url' => array('max' => 250, 'min' => 0)));
// Get the validated parameters only
$params = $cValidator->convert_to_get();
$idx_array = $this->get_content_indices();
if (empty($idx_array)) {
$msg->add_session($cStrings->ERROR_PLUGIN_INVALID_PAGE);
tep_redirect(tep_href_link($cDefs->script, $params));
}
$error = false;
if (!empty($result_array['rating'])) {
$msg->add($cStrings->ERROR_PLUGIN_INVALID_RATING);
$error = true;
}
if (!empty($result_array['name'])) {
$msg->add($cStrings->ERROR_PLUGIN_INVALID_NAME);
$error = true;
}
if (!empty($result_array['comment'])) {
$msg->add($cStrings->ERROR_PLUGIN_INVALID_COMMENT);
$error = true;
}
if (!empty($result_array['url'])) {
$msg->add($cStrings->ERROR_PLUGIN_INVALID_URL);
$error = true;
}
if (!empty($result_array['email'])) {
$msg->add($cStrings->ERROR_PLUGIN_INVALID_EMAIL);
$error = true;
}
if ($error) {
return true;
}
$error = false;
$body = $db->prepare_input($_POST['comment'], false);
$body_key = md5($body);
if ($this->check_reentry($body_key)) {
$msg->add_session($cStrings->ERROR_PLUGIN_ALREADY_SUBMITTED);
tep_redirect(tep_href_link($cDefs->script, $params));
}
if (!tep_validate_email($_POST['email'])) {
$msg->add($cStrings->ERROR_PLUGIN_INVALID_EMAIL);
$error = true;
}
$url = $db->prepare_input($_POST['url']);
if (!tep_validate_url($url)) {
if (!empty($_POST['url'])) {
$msg->add($cStrings->ERROR_PLUGIN_INVALID_URL);
$error = true;
}
$url = '';
}
if (!empty($url) && substr($url, 0, 7) != 'http://') {
$url = 'http://' . $url;
}
if ($error) {
return true;
}
$body = $db->prepare_input($_POST['comment'], false);
$sql_data_array = array('comments_id' => (int) $idx_array['id'], 'content_type' => (int) $idx_array['type_id'], 'comments_author' => $db->prepare_input($_POST['name']), 'comments_email' => $db->prepare_input($_POST['email']), 'comments_url' => $url, 'comments_body' => $body, 'comments_key' => $body_key, 'ip_address' => $db->prepare_input($http->ip_string), 'comments_rating' => (int) $_POST['rating'], 'resolution' => (int) $this->options['rating_steps'], 'date_added' => 'now()', 'status_id' => (int) $this->options['auto_display']);
$db->perform(TABLE_COMMENTS, $sql_data_array);
$msg->add_session($cStrings->SUCCESS_PLUGIN_COMMENT_ACCEPTED, 'success');
$cSessions->unregister($this->key);
tep_redirect(tep_href_link($cDefs->script, $params));
return false;
}
示例10: array
$account_array = $g_db->fetch_array($account_query);
$from_email_address = $account_array['email_address'];
$to_name = $g_db->prepare_input($_POST['to_name']);
$to_email_address = $g_db->prepare_input($_POST['to_email_address']);
$subject = $g_db->prepare_input($_POST['subject']);
$body = $g_db->prepare_input($_POST['body']);
$error = false;
if (empty($subject)) {
$messageStack->add(ERROR_EMPTY_SUBJECT);
$error = true;
}
if (empty($body)) {
$messageStack->add(ERROR_EMPTY_BODY);
$error = true;
}
if (!tep_validate_email($from_email_address) || !tep_validate_email($to_email_address)) {
$messageStack->add(ERROR_EMAIL_ADDRESS);
$error = true;
}
if ($error) {
$action = 'view';
break;
}
$sql_data_array = array('priority_id' => (int) $priority_id, 'status_id' => (int) $status_id, 'department_id' => (int) $department_id, 'datestamp_last_entry' => 'now()');
if ($subaction == 'new') {
if (!empty($account_array['ticket_prefix'])) {
do {
// create & check for dups until unique
//$ticket = osc_create_random_string();
$ticket = tep_create_random_value(7, 'mixed_upper', true);
$check_query = $g_db->query("select count(*) as count from " . TABLE_HELPDESK_TICKETS . " where ticket = '" . $g_db->input($ticket) . "'");
示例11: email
$messageStack->add(ERROR_ENQUIRY_EMPTY);
$error = true;
}
if (empty($subject)) {
$messageStack->add(ERROR_SUBJECT_EMPTY);
$error = true;
}
if (empty($name)) {
$messageStack->add(ERROR_NAME_EMPTY);
$error = true;
}
if ($error) {
break;
}
$email_subject = $subject . ' ' . EMAIL_SUBJECT;
if (tep_validate_email($email)) {
// Help Desk
$department_query = $g_db->query("select email_address, name from " . TABLE_HELPDESK_DEPARTMENTS . " where department_id = '" . (int) $_POST['department_id'] . "' and front='1'");
if ($g_db->num_rows($department_query)) {
$department = $g_db->fetch_array($department_query);
require_once DIR_FS_CLASSES . 'email.php';
$mailer = new email();
$result = $mailer->send_mail($department['name'], $department['email_address'], $email_subject, $_POST['enquiry'], $_POST['name'], $_POST['email'], '');
if (!$result) {
$messageStack->add_session(ERROR_SEND_MAIL);
} else {
$messageStack->add_session(SUCCESS_ENQUIRY_SENT, 'success');
}
tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
break;
} else {
示例12: tep_db_prepare_input
$partners_name = tep_db_prepare_input($HTTP_POST_VARS['partners_name']);
$partners_email_address = tep_db_prepare_input($HTTP_POST_VARS['partners_email_address']);
$partners_url = tep_db_prepare_input($HTTP_POST_VARS['partners_url']);
$partners_url = str_replace('http://', '', $partners_url);
$partners_comments = tep_db_prepare_input($HTTP_POST_VARS['partners_comments']);
$partners_bank = tep_db_prepare_input($HTTP_POST_VARS['partners_bank']);
$partners_telephone = tep_db_prepare_input($HTTP_POST_VARS['partners_telephone']);
$error = false;
if (empty($partners_name)) {
$error = true;
$messageStack->add('header', ENTRY_PARTNER_NAME_ERROR);
}
if (empty($partners_email_address)) {
$error = true;
$messageStack->add('header', ENTRY_PARTNER_EMAIL_ADDRESS_ERROR);
} elseif (tep_validate_email($partners_email_address) == false) {
$error = true;
$messageStack->add('header', ENTRY_PARTNER_EMAIL_ADDRESS_CHECK_ERROR);
}
if ($error == false) {
$sql_data_array = array('partners_name' => $partners_name, 'partners_email_address' => $partners_email_address, 'partners_url' => $partners_url, 'partners_bank' => $partners_bank, 'partners_telephone' => $partners_telephone, 'partners_comments' => $partners_comments, 'date_of_last_logon' => 'now()', 'partners_register_type' => 'manual');
$sql_data_array['last_modified'] = 'now()';
tep_db_perform(TABLE_PARTNERS, $sql_data_array, 'update', "partners_id = '" . (int) $partner_id . "'");
$partner_name = $partners_name;
$messageStack->add_session('header', SUCCESS_PARTNER_ACCOUNT_UPDATED, 'success');
tep_redirect(tep_href_link(FILENAME_PARTNER, '', 'SSL'));
}
break;
case 'remind_password_process':
$partners_login = tep_db_prepare_input($HTTP_POST_VARS['partners_login']);
$check_partner_query = tep_db_query("select partners_id, partners_name, partners_password, partners_email_address from " . TABLE_PARTNERS . " where partners_login = '" . tep_db_input($partners_login) . "'");
示例13: tep_redirect
} else {
$cart->add_cart($_GET['pid'], $cart->get_quantity($_GET['pid']) + 1);
}
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
}
}
// include the who's online functions
require DIR_WS_FUNCTIONS . 'whos_online.php';
tep_update_whos_online();
// include the password crypto functions
require DIR_WS_FUNCTIONS . 'password_funcs.php';
// include validation functions (right now only email address)
require DIR_WS_FUNCTIONS . 'validations.php';
if (isset($customers_email_address) && $customers_email_address != '' && tep_validate_email($customers_email_address) == false) {
if (!strstr($_SERVER['PHP_SELF'], FILENAME_ACCOUNT_SUBMIT_EMAIL) && !strstr($_SERVER['PHP_SELF'], FILENAME_LOGOFF)) {
tep_redirect(tep_href_link(FILENAME_ACCOUNT_SUBMIT_EMAIL));
}
}
// split-page-results
require DIR_WS_CLASSES . 'split_page_results.php';
// infobox
require DIR_WS_CLASSES . 'boxes.php';
// auto activate and expire banners
require DIR_WS_FUNCTIONS . 'banner.php';
tep_activate_banners();
tep_expire_banners();
// auto expire special products
require DIR_WS_FUNCTIONS . 'specials.php';
tep_expire_specials();
示例14: newsletter_subscribe
function newsletter_subscribe()
{
extract(tep_load('defs', 'database', 'validator', 'message_stack'));
$cStrings =& $this->strings;
// Get the validated parameters only
$params = $cValidator->convert_to_get();
if (!isset($_POST['email']) || !tep_validate_email($_POST['email'])) {
$msg->add_session($cStrings->ERROR_PLUGIN_INVALID_EMAIL);
tep_redirect(tep_href_link($cDefs->script, $params));
}
$customer_id = $mode = 0;
$check_query = $db->query("select customers_id, customers_email, newsletter from " . TABLE_CUSTOMERS . " where customers_email = '" . $db->filter($_POST['email']) . "'");
if (!$db->num_rows($check_query)) {
$mode = 1;
} else {
$check_array = $db->fetch_array($check_query);
$customer_id = $check_array['customers_id'];
$mode = 2;
if (!empty($check_array['newsletter'])) {
$mode = 4;
}
}
if (isset($_POST['remove']) && $mode == 2) {
$mode = 5;
} elseif (isset($_POST['remove']) && $mode != 1) {
$mode = 3;
} elseif (isset($_POST['remove']) && $mode == 1) {
$mode = 6;
}
switch ($mode) {
case 1:
$sql_data_array = array('customers_email' => $db->prepare_input($_POST['email']), 'newsletter' => serialize(array()));
$db->perform(TABLE_CUSTOMERS, $sql_data_array);
break;
case 2:
$sql_data_array = array('newsletter' => serialize(array()));
$db->perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id= '" . (int) $customer_id . "'");
$msg->add_session($cStrings->SUCCESS_PLUGIN_EMAIL_SUBSCRIBED, 'success');
break;
case 3:
$sql_data_array = array('newsletter' => 'null');
$db->perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id= '" . (int) $customer_id . "'");
$msg->add_session(sprintf($cStrings->SUCCESS_PLUGIN_EMAIL_REMOVED, $check_array['customers_email']), 'success');
break;
case 4:
$msg->add_session($cStrings->ERROR_PLUGIN_EXISTING_EMAIL);
break;
case 5:
$msg->add_session($cStrings->ERROR_PLUGIN_ALREADY_REMOVED_EMAIL);
break;
default:
break;
}
tep_redirect(tep_href_link($cDefs->script, $params));
/*
$check_array = $db->fetch_array($check_query);
if( $check_array['total'] ) {
$msg->add_session($cStrings->ERROR_PLUGIN_EXISTING_EMAIL);
tep_redirect(tep_href_link($cDefs->script, $params));
}
$sql_data_array = array(
'customers_email' => $db->prepare_input($_POST['email']),
'newsletter' => serialize(array()),
);
$db->perform(TABLE_CUSTOMERS, $sql_data_array);
$msg->add_session($cStrings->SUCCESS_PLUGIN_EMAIL_SUBSCRIBED);
tep_redirect(tep_href_link($cDefs->script, $params));
*/
}
示例15: mktime
if (!isset($_POST['firstname']) || strlen(trim($_POST['firstname'])) < ACCOUNT_FIRST_NAME) {
$messageStack->add('create_account', ENTRY_FIRST_NAME_ERROR);
}
if (!isset($_POST['lastname']) || strlen(trim($_POST['lastname'])) < ACCOUNT_LAST_NAME) {
$messageStack->add('create_account', ENTRY_LAST_NAME_ERROR);
}
if (ACCOUNT_DATE_OF_BIRTH > -1) {
if (isset($_POST['dob_days']) && isset($_POST['dob_months']) && isset($_POST['dob_years']) && checkdate($_POST['dob_months'], $_POST['dob_days'], $_POST['dob_years'])) {
$dob = mktime(0, 0, 0, $_POST['dob_months'], $_POST['dob_days'], $_POST['dob_years']);
} else {
$messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR);
}
}
if (!isset($_POST['email_address']) || strlen(trim($_POST['email_address'])) < ACCOUNT_EMAIL_ADDRESS) {
$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR);
} elseif (tep_validate_email($_POST['email_address']) == false) {
$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
} else {
$Qcheck = $osC_Database->query('select customers_id from :table_customers where customers_email_address = :customers_email_address limit 1');
$Qcheck->bindRaw(':table_customers', TABLE_CUSTOMERS);
$Qcheck->bindValue(':customers_email_address', $_POST['email_address']);
$Qcheck->execute();
if ($Qcheck->numberOfRows() > 0) {
$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
}
$Qcheck->freeResult();
}
if (!isset($_POST['password']) || strlen(trim($_POST['password'])) < ACCOUNT_PASSWORD) {
$messageStack->add('create_account', ENTRY_PASSWORD_ERROR);
} elseif (!isset($_POST['confirmation']) || trim($_POST['password']) != trim($_POST['confirmation'])) {
$messageStack->add('create_account', ENTRY_PASSWORD_ERROR_NOT_MATCHING);