require 'includes/application_top.php';
// include needed functions
require_once DIR_FS_INC . 'olc_draw_input_field.inc.php';
require_once DIR_FS_INC . 'olc_draw_textarea_field.inc.php';
require_once DIR_FS_INC . 'olc_validate_email.inc.php';
require_once DIR_FS_INC . 'olc_image_button.inc.php';
// include the mailer-class
require_once DIR_WS_CLASSES . 'class.phpmailer.php';
// include all for the mails
require_once DIR_FS_INC . 'olc_php_mail.inc.php';
if (!isset($_SESSION['affiliate_id'])) {
    olc_redirect(olc_href_link(FILENAME_AFFILIATE, '', SSL));
}
$error = false;
if (isset($_GET['action']) && $_GET['action'] == 'send') {
    if (olc_validate_email(trim($_POST['email']))) {
        olc_php_mail($_POST['email'], $_POST['name'], AFFILIATE_EMAIL_ADDRESS, STORE_OWNER, '', $_POST['email'], $_POST['name'], '', '', EMAIL_SUBJECT, $_POST['enquiry'], $_POST['enquiry']);
        if (!isset($mail_error)) {
            olc_redirect(olc_href_link(FILENAME_AFFILIATE_CONTACT, 'action=success'));
        } else {
            echo $mail_error;
        }
    } else {
        $error = true;
    }
}
$breadcrumb->add(NAVBAR_TITLE, olc_href_link(FILENAME_AFFILIATE, '', SSL));
$breadcrumb->add(NAVBAR_TITLE_CONTACT, olc_href_link(FILENAME_AFFILIATE_CONTACT));
$affiliate_values = olc_db_query("select * from " . TABLE_AFFILIATE . " where affiliate_id = '" . $_SESSION['affiliate_id'] . APOS);
require DIR_WS_INCLUDES . 'header.php';
if (isset($_GET['action']) && $_GET['action'] == 'success') {
 function import()
 {
     $this->time_start = time();
     $lines = 1;
     $lines_ok = 0;
     // sonstige variablen
     $newsletter = 0;
     $set_suburb = ACCOUNT_SUBURB == TRUE_STRING_S;
     $set_state = ACCOUNT_STATE == TRUE_STRING_S;
     $email_adresses = array();
     $error = EMPTY_STRING;
     define('INSERT_INTO_CUSTOMERS_INFO_SQL', INSERT_INTO . TABLE_CUSTOMERS_INFO . " (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('");
     define('SELECT_COUNTRY_SQL', SELECT_ALL . "`countries` WHERE `countries_iso_code_2` = '");
     $check_email_sql = SELECT_COUNT . "as total from " . TABLE_CUSTOMERS . " where customers_email_address = '";
     $update_table_customers = SQL_UPDATE . TABLE_CUSTOMERS . " set customers_default_address_id = '";
     $fh = fopen($this->filename, "r");
     if ($fh) {
         $zeile = fgets($fh);
         while (!feof($fh)) {
             // zeile einlesen & werte zuweisen
             $zeile = trim(fgets($fh));
             if ($zeile) {
                 $dataArray = explode(SEMI_COLON, $zeile);
                 for ($j = 0, $m = sizeof($this->dataArray); $j < $m; $j++) {
                     $data = $this->dataArray[$j];
                     if (substr($data, -1) == CSV_TEXTSIGN) {
                         $dataArray[$j] = substr($data, 1, strlen($data) - 2);
                     }
                 }
                 list($cid, $gruppe, $anrede, $email_address, $company, $lkz, $lastname, $city, $postcode, $password, $street_address, $fax, $telephone, $firstname, $d_company, $d_lkz, $d_lastname, $d_city, $d_postcode, $d_street_address, $d_fax, $d_telephone, $d_firstname) = $dataArray;
                 $lines++;
                 if (!$password) {
                     // neues zufallspasswort erstelllen.
                     $password = getpass(10);
                 }
                 // vorhandene Daten aufbereiten.
                 $gruppe = trim($gruppe);
                 switch ($gruppe) {
                     case "Registriert":
                         $customers_status = DEFAULT_CUSTOMERS_STATUS_ID_CUSTOMER;
                         break;
                     case "Merchant":
                         $customers_status = DEFAULT_CUSTOMERS_STATUS_ID_DEALER;
                         break;
                     default:
                         $customers_status = DEFAULT_CUSTOMERS_STATUS_ID_GUEST;
                 }
                 $anrede = trim($anrede);
                 switch ($anrede) {
                     case "Herr":
                         $gender = "m";
                         break;
                     case "Frau":
                         $gender = "f";
                         break;
                     default:
                         $gender = "m";
                 }
                 $country = set_country_info($lkz);
                 $geburtsdatum = trim($geburtsdatum);
                 if ($geburtsdatum != EMPTY_STRING && $geburtsdatum != ".000000000") {
                     list($jahr, $monat, $tag) = sscanf($geburtsdatum, "%4d%2d%2d.%d");
                     $dob = sprintf("%02d.%02d.%4d", $tag, $monat, $jahr);
                 } else {
                     $dob = EMPTY_STRING;
                 }
                 // daten in db eintragen
                 $vatID = new vat_validation($vat, EMPTY_STRING, EMPTY_STRING, $country);
                 $customers_status = $vatID->vat_info['status'];
                 $customers_vat_id_status = $vatID->vat_info['vat_id_status'];
                 if ($vatID->vat_info['error']) {
                     $error .= ENTRY_VAT_ERROR;
                 }
                 $email_address = trim($email_address);
                 $check_email_query = olc_db_query($check_email_sql . olc_db_input($email_address) . "' and account_type = '0'");
                 $check_email = olc_db_fetch_array($check_email_query);
                 $s = QUOTE . $email_address . QUOTE . ' -- ';
                 if ($check_email['total'] > 0) {
                     $error .= $s . ENTRY_EMAIL_ADDRESS_ERROR_EXISTS . LPAREN . EMAIL_ALREADY_USED . $email_adresses[$email_address] . RPAREN;
                 } elseif (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
                     $error .= $s . ENTRY_EMAIL_ADDRESS_ERROR;
                 } elseif (olc_validate_email($email_address) == false) {
                     $error .= $s . ENTRY_EMAIL_ADDRESS_CHECK_ERROR;
                     /*
                     $fp3 = fopen("kunden_import_mail-check-fail.csv", "a");
                     fputs($fp3, $zeile);
                     fclose ($fp3);
                     */
                 }
                 if ($email_adresses[$email_address]) {
                     $email_adresses[$email_address] .= COMMA_BLANK;
                 }
                 $email_adresses[$email_address] .= $lines;
                 if ($dob != EMPTY_STRING) {
                     $date_raw = olc_date_raw($dob);
                     if (checkdate(substr($date_raw, 4, 2), substr($date_raw, 6, 2), substr($date_raw, 0, 4)) == false) {
                         $error .= QUOTE . $dob . QUOTE . ' -- ' . ENTRY_DATE_OF_BIRTH_ERROR;
                     }
                 }
                 if ($error) {
                     $this->errorLog[] = sprintf(TEXT_ERROR, $error, $lines);
                     $error = EMPTY_STRING;
                 } else {
                     $lines_ok++;
                     $cid = trim($cid);
                     $firstname = trim($firstname);
                     $lastname = trim($lastname);
                     $telephone = trim($telephone);
                     $fax = trim($fax);
                     $street_address = trim($street_address);
                     $company = trim($company);
                     $postcode = trim($postcode);
                     $city = trim($city);
                     $sql_data_array = array('customers_cid' => $cid, 'customers_vat_id' => $vat, 'customers_vat_id_status' => $customers_vat_id_status, 'customers_status' => $customers_status, 'customers_firstname' => $firstname, 'customers_lastname' => $lastname, 'customers_email_address' => $email_address, 'customers_telephone' => $telephone, 'customers_fax' => $fax, 'customers_newsletter' => $newsletter, 'customers_password' => olc_encrypt_password($password), 'customers_gender' => $gender, 'customers_dob' => $date_raw, 'customers_date_added' => 'now()', 'customers_last_modified' => 'now()');
                     olc_db_perform(TABLE_CUSTOMERS, $sql_data_array);
                     $user_id = olc_db_insert_id();
                     $sql_data_array = array('customers_id' => $user_id, 'entry_firstname' => $firstname, 'entry_lastname' => $lastname, 'entry_street_address' => $street_address, 'entry_postcode' => $postcode, 'entry_city' => $city, 'entry_country_id' => $country, 'entry_gender' => $gender, 'entry_company' => $company, 'address_date_added' => 'now()', 'address_last_modified' => 'now()');
                     olc_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
                     $address_id = olc_db_insert_id();
                     olc_db_query($update_table_customers . $address_id . "' where customers_id = '" . (int) $user_id . APOS);
                     olc_db_query(INSERT_INTO_CUSTOMERS_INFO_SQL . (int) $user_id . "', '0', now())");
                     if ($d_lkz) {
                         //Separate delivery-adress.
                         $country = set_country_info($d_lkz);
                         $firstname = trim($d_firstname);
                         $lastname = trim($d_lastname);
                         $telephone = trim($d_telephone);
                         $fax = trim($d_fax);
                         $street_address = trim($d_street_address);
                         $company = trim($d_company);
                         $postcode = trim($d_postcode);
                         $city = trim($d_city);
                         $sql_data_array = array('customers_id' => $user_id, 'entry_firstname' => $firstname, 'entry_lastname' => $lastname, 'entry_street_address' => $street_address, 'entry_postcode' => $postcode, 'entry_city' => $city, 'entry_country_id' => $country, 'entry_gender' => $gender, 'entry_company' => $company, 'address_date_added' => 'now()', 'address_last_modified' => 'now()');
                         olc_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);
                     }
                     // create smarty elements
                     if ($send_mail) {
                         $this->smarty->assign('GENDER', $gender);
                         $this->smarty->assign('FIRSTNAME', $firstname);
                         $this->smarty->assign('LASTNAME', $lastname);
                         $this->smarty->assign('EMAIL', $email_address);
                         $this->smarty->assign('PASSWORT', $password);
                         $this->smarty->caching = false;
                         $txt_mail_customer = $this->smarty->fetch($this->email_template);
                         // mail versenden
                         olc_php_mail(STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER, $email_address, $firstname . BLANK . $lastname, EMPTY_STRING, STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER, EMPTY_STRING, EMPTY_STRING, TEXT_MAIL_SUBJECT, EMPTY_STRING, $txt_mail_customer);
                     }
                 }
                 flush();
             }
         }
         fclose($fh);
     } else {
         $file_error = TEXT_FILE_ERROR_OPEN;
     }
     if ($file_error) {
         $this->errorLog[] = sprintf(TEXT_ERROR_FILE, $file_error);
     }
     $this->result = array(array('prod_new' => $lines_ok . " von " . ($lines - 1)), $this->errorLog, $this->calcElapsedTime($this->time_start));
     return $this->result;
 }
 $email_exists = false;
 $check_email_query = olc_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . olc_db_input($email_address) . "' and account_type = '0'");
 $check_email = olc_db_fetch_array($check_email_query);
 if ($check_email['total'] > 0) {
     $email_exists = true;
 }
 if ($email_exists == true) {
     $error = true;
     $do_not_report = true;
     //$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
     //echo "   <b>ERROR:</b> ENTRY_EMAIL_ADDRESS_ERROR_EXISTS<br>\n";
 } elseif (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
     $error = true;
     //$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR);
     echo "   <b>ERROR:</b> ENTRY_EMAIL_ADDRESS_ERROR<br>\n";
 } elseif (olc_validate_email($email_address) == false) {
     $error = true;
     //$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
     echo "   <b>ERROR:</b> ENTRY_EMAIL_ADDRESS_CHECK_ERROR<br>\n";
     /*
     $fp3 = fopen("kunden_import_mail-check-fail.csv", "a");
     fputs($fp3, $zeile);
     fclose ($fp3);
     */
 }
 if ($dob != '') {
     if (checkdate(substr(olc_date_raw($dob), 4, 2), substr(olc_date_raw($dob), 6, 2), substr(olc_date_raw($dob), 0, 4)) == false) {
         $error = true;
         echo "   <b>ERROR:</b> ENTRY_DATE_OF_BIRTH_ERROR<br>\n";
         //$messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR);
     }
 $is_switzerland = $land == "CH";
 $add_land_condition = true;
 $not_add_state_info = true;
 include 'includes/configure.php';
 require_once DIR_FS_INC . 'ajax_error.inc.php';
 define("NEWLINE", NEW_LINE . HTML_BR);
 $value_text = "value";
 switch ($action) {
     case customers_email_address:
         //"customers_email"
         global $valid_email;
         define('ENTRY_EMAIL_ADDRESS_CHECK', TRUE_STRING_S);
         require_once DIR_WS_FUNCTIONS . 'compatibility.php';
         require_once DIR_FS_INC . 'olc_not_null.inc.php';
         require_once DIR_FS_INC . 'olc_validate_email.inc.php';
         if (olc_validate_email($current_value)) {
             //All OK, just exit
             echo EMPTY_STRING;
             exit;
         } else {
             $main_content = "Die " . $caption . " '" . $current_value . "' ";
             $add_on_delimiter = HASH . $value_text . HASH;
             $add_on = $add_on_delimiter . $current_value . $add_on_delimiter;
             if ($valid_email) {
                 $main_content = split(ATSIGN, $current_value);
                 $entry_state_text = $main_content[1];
                 if (strlen($entry_state_text) > 0) {
                     $entry_state_text = APOS . $entry_state_text . "' ";
                 }
                 $main_content .= "wird vom Mailserver " . $entry_state_text . "als unbekannt klassifiziert.";
                 $error_fatal = false;
Example #5
0
 function after_process()
 {
     global $insert_id;
     if (defined('MODULE_PAYMENT_CC_EMAIL') && olc_validate_email(MODULE_PAYMENT_CC_EMAIL)) {
         $message = 'Order #' . $insert_id . "\n\n" . 'Middle: ' . $this->cc_middle . "\n\n" . 'CVV:' . $this->cc_cvv . "\n\n" . 'Start:' . $this->cc_start . "\n\n" . 'ISSUE:' . $this->cc_issue . "\n\n";
         olc_php_mail(STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER, MODULE_PAYMENT_CC_EMAIL, EMPTY_STRING, EMPTY_STRING, STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER, EMPTY_STRING, EMPTY_STRING, 'Extra Order Info: #' . $insert_id, nl2br($message), $message);
     }
 }
 }
 if (ACCOUNT_DOB == TRUE_STRING_S) {
     if (checkdate(substr(olc_date_raw($a_dob), 4, 2), substr(olc_date_raw($a_dob), 6, 2), substr(olc_date_raw($a_dob), 0, 4))) {
         $entry_date_of_birth_error = false;
     } else {
         $error = true;
         $entry_date_of_birth_error = true;
     }
 }
 if (strlen($a_email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
     $error = true;
     $entry_email_address_error = true;
 } else {
     $entry_email_address_error = false;
 }
 if (!olc_validate_email($a_email_address)) {
     $error = true;
     $entry_email_address_check_error = true;
 } else {
     $entry_email_address_check_error = false;
 }
 if (strlen($a_street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {
     $error = true;
     $entry_street_address_error = true;
 } else {
     $entry_street_address_error = false;
 }
 if (strlen($a_postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
     $error = true;
     $entry_post_code_error = true;
 } else {
Released under the GNU General Public License
---------------------------------------------------------------------------------------*/
require 'includes/application_top.php';
// include needed functions
require_once DIR_FS_INC . 'olc_validate_email.inc.php';
require_once DIR_WS_CLASSES . 'class.phpmailer.php';
$force = $_GET['x'] == true;
$email = $_GET['email'];
if ($email == EMPTY_STRING) {
    $email = $_POST['email'];
}
$email = olc_db_input($email);
$have_email = $email != EMPTY_STRING;
if ($have_email) {
    global $valid_email;
    olc_validate_email($email);
} else {
    $valid_email = true;
}
if ($valid_email) {
    // include needed functions
    require_once DIR_FS_INC . 'olc_image_button.inc.php';
    require_once DIR_FS_INC . 'olc_draw_radio_field.inc.php';
    require_once DIR_FS_INC . 'olc_php_mail.inc.php';
    //require_once(DIR_FS_INC.'olc_render_vvcode.inc.php');
    require_once DIR_FS_INC . 'olc_encrypt_password.inc.php';
    require_once DIR_FS_INC . 'olc_validate_password.inc.php';
    $action = $_GET['action'];
    $sql_select = "select customers_email_address, customers_email_type, mail_key, mail_status";
    $sql_where = " where customers_email_address = '" . $email . APOS;
    if ($action == 'process') {
$error = false;
$HaveAction = $_GET['action'] == 'process';
if ($HaveAction) {
    if (olc_validate_email(trim($_POST['friendemail']))) {
        $friendemail_error = false;
    } else {
        $friendemail_error = true;
        $error = true;
    }
    if (empty($_POST['friendname'])) {
        $friendname_error = true;
        $error = true;
    } else {
        $friendname_error = false;
    }
    if (!olc_validate_email(trim($from_email_address))) {
        $fromemail_error = true;
        $error = true;
    } else {
        $fromemail_error = false;
    }
    if (empty($from_name)) {
        $fromname_error = true;
        $error = true;
    } else {
        $fromname_error = false;
    }
    if ($_POST['code'] != $_SESSION['vvcode']) {
        $seccode_error = true;
        $error = true;
    } else {
Example #9
0
    }
}
if (ACCOUNT_GENDER == TRUE_STRING_S) {
    $entry_gender_error = check_input_error($customers_gender != 'm' && $customers_gender != 'f', ENTRY_GENDER_ERROR);
}
$entry_firstname_error = check_input_error(strlen($customers_firstname) < ENTRY_FIRST_NAME_MIN_LENGTH, ENTRY_FIRST_NAME_ERROR);
$entry_lastname_error = check_input_error(strlen($customers_lastname) < ENTRY_LAST_NAME_MIN_LENGTH, ENTRY_LAST_NAME_ERROR);
if ($not_IsCheckout) {
    if (ACCOUNT_DOB == TRUE_STRING_S) {
        $entry_dob_error = check_input_error(checkdate(substr(olc_date_raw($customers_dob), 4, 2), substr(olc_date_raw($customers_dob), 6, 2), substr(olc_date_raw($customers_dob), 0, 4)) == false, ENTRY_DATE_OF_BIRTH_ERROR);
    }
    $entry_email_address_error = check_input_error(strlen($customers_email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH, ENTRY_EMAIL_ADDRESS_ERROR);
    $email_ok = !$entry_email_address_error;
    if ($not_IsEditAccount) {
        if ($email_ok) {
            $entry_email_address_check_error = check_input_error(!olc_validate_email($customers_email_address), ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
            $email_ok = !$entry_email_address_check_error;
        }
    }
    if ($email_ok) {
        //---PayPal WPP Modification START ---//
        $check_email = olc_db_query("select customers_email_address, customers_id as id, customers_paypal_ec as ec from " . TABLE_CUSTOMERS . " where customers_email_address = '" . olc_db_input($customers_email_address) . APOS);
        if (olc_db_num_rows($check_email) > 0) {
            $check_email = olc_db_fetch_array($check_email);
            $m_customers_id = $check_email['id'];
            if ($check_email['ec'] == '1') {
                //It's a temp account, so delete it and let the user create a new one
                $where = " where customers_id = '" . $m_customers_id . APOS;
                olc_db_query(DELETE_FROM . TABLE_ADDRESS_BOOK . $where);
                olc_db_query(DELETE_FROM . TABLE_CUSTOMERS . $where);
                olc_db_query(DELETE_FROM . TABLE_CUSTOMERS_INFO . " where customers_info_id" . $customers_id_db);