protected function _process() { global $lC_Language, $lC_MessageStack, $lC_Product; if (empty($_POST['from_name'])) { $lC_MessageStack->add('tell_a_friend', $lC_Language->get('error_tell_a_friend_customers_name_empty')); } if (!lc_validate_email_address($_POST['from_email_address'])) { $lC_MessageStack->add('tell_a_friend', $lC_Language->get('error_tell_a_friend_invalid_customers_email_address')); } if (empty($_POST['to_name'])) { $lC_MessageStack->add('tell_a_friend', $lC_Language->get('error_tell_a_friend_friends_name_empty')); } if (!lc_validate_email_address($_POST['to_email_address'])) { $lC_MessageStack->add('tell_a_friend', $lC_Language->get('error_tell_a_friend_invalid_friends_email_address')); } if ($lC_MessageStack->size('tell_a_friend') < 1) { $email_subject = sprintf($lC_Language->get('email_tell_a_friend_subject'), lc_sanitize_string($_POST['from_name']), STORE_NAME); $email_body = sprintf($lC_Language->get('email_tell_a_friend_intro'), lc_sanitize_string($_POST['to_name']), lc_sanitize_string($_POST['from_name']), $lC_Product->getTitle(), STORE_NAME) . "\n\n"; if (!empty($_POST['message'])) { $email_body .= lc_sanitize_string($_POST['message']) . "\n\n"; } $email_body .= sprintf($lC_Language->get('email_tell_a_friend_link'), lc_href_link(HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCTS, $lC_Product->getKeyword(), 'NONSSL', false)) . "\n\n" . sprintf($lC_Language->get('email_tell_a_friend_signature'), STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n"); lc_email(lc_sanitize_string($_POST['to_name']), lc_sanitize_string($_POST['to_email_address']), $email_subject, $email_body, lc_sanitize_string($_POST['from_name']), lc_sanitize_string($_POST['from_email_address'])); lc_redirect(lc_href_link(FILENAME_PRODUCTS, 'tell_a_friend&' . $lC_Product->getID() . '&success=' . urlencode(sprintf($lC_Language->get('success_tell_a_friend_email_sent'), $lC_Product->getTitle(), lc_output_string_protected($_POST['to_name']))))); } }
protected function _process() { global $lC_MessageStack, $lC_Database, $lC_Language, $lC_Customer, $lC_Vqmod; require_once $lC_Vqmod->modCheck('includes/classes/account.php'); $data = array(); if (ACCOUNT_GENDER >= 0) { if (isset($_POST['gender']) && ($_POST['gender'] == 'm' || $_POST['gender'] == 'f')) { $data['gender'] = $_POST['gender']; } else { $lC_MessageStack->add('account_edit', $lC_Language->get('field_customer_gender_error')); } } if (isset($_POST['firstname']) && strlen(trim($_POST['firstname'])) >= ACCOUNT_FIRST_NAME) { $data['firstname'] = $_POST['firstname']; } else { $lC_MessageStack->add('account_edit', sprintf($lC_Language->get('field_customer_first_name_error'), ACCOUNT_FIRST_NAME)); } if (isset($_POST['lastname']) && strlen(trim($_POST['lastname'])) >= ACCOUNT_LAST_NAME) { $data['lastname'] = $_POST['lastname']; } else { $lC_MessageStack->add('account_edit', sprintf($lC_Language->get('field_customer_last_name_error'), ACCOUNT_LAST_NAME)); } if (ACCOUNT_DATE_OF_BIRTH == '1') { $dateParts = explode("/", $_POST['dob']); if (isset($_POST['dob']) && checkdate($dateParts[0], $dateParts[1], $dateParts[2])) { $data['dob'] = @mktime(0, 0, 0, $dateParts[0], $dateParts[1], $dateParts[2]); } else { $lC_MessageStack->add('account_edit', $lC_Language->get('field_customer_date_of_birth_error')); } } if (isset($_POST['email_address']) && strlen(trim($_POST['email_address'])) >= ACCOUNT_EMAIL_ADDRESS) { if (lc_validate_email_address($_POST['email_address'])) { if (lC_Account::checkDuplicateEntry($_POST['email_address']) === false) { $data['email_address'] = $_POST['email_address']; } else { $lC_MessageStack->add('account_edit', $lC_Language->get('field_customer_email_address_exists_error')); } } else { $lC_MessageStack->add('account_edit', $lC_Language->get('field_customer_email_address_check_error')); } } else { $lC_MessageStack->add('account_edit', sprintf($lC_Language->get('field_customer_email_address_error'), ACCOUNT_EMAIL_ADDRESS)); } if ($lC_MessageStack->size('account_edit') === 0) { if (lC_Account::saveEntry($data)) { // reset the session variables if (ACCOUNT_GENDER > -1) { $lC_Customer->setGender($data['gender']); } $lC_Customer->setFirstName(trim($data['firstname'])); $lC_Customer->setLastName(trim($data['lastname'])); $lC_Customer->setEmailAddress($data['email_address']); $lC_MessageStack->add('account', $lC_Language->get('success_account_updated'), 'success'); } lc_redirect(lc_href_link(FILENAME_ACCOUNT, null, 'SSL')); } }
protected function _process() { global $lC_Language, $lC_MessageStack; $name = lc_sanitize_string($_POST['name']); $email_address = lc_sanitize_string($_POST['email']); $inquiry = lc_sanitize_string($_POST['inquiry']); if (lc_validate_email_address($email_address)) { lc_email(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $lC_Language->get('contact_email_subject'), $inquiry, $name, $email_address); lc_redirect(lc_href_link(FILENAME_INFO, 'contact&success=' . urlencode($lC_Language->get('contact_email_sent_successfully')), 'AUTO')); } else { $lC_MessageStack->add('contact', $lC_Language->get('field_customer_email_address_check_error')); } }
protected function _process() { global $lC_MessageStack, $lC_Database, $lC_Language, $lC_Customer, $lC_Vqmod; require $lC_Vqmod->modCheck('includes/classes/account.php'); $data = array(); if (DISPLAY_PRIVACY_CONDITIONS == '1') { if (isset($_POST['privacy_conditions']) && ($_POST['privacy_conditions'] == '1' || $_POST['privacy_conditions'] == 'on')) { } else { $lC_MessageStack->add($this->_module, $lC_Language->get('error_privacy_statement_not_accepted')); } } if (ACCOUNT_GENDER >= 0) { if (isset($_POST['gender']) && ($_POST['gender'] == 'm' || $_POST['gender'] == 'f')) { $data['gender'] = $_POST['gender']; } else { $lC_MessageStack->add($this->_module, $lC_Language->get('field_customer_gender_error')); } } if (isset($_POST['firstname']) && strlen(trim($_POST['firstname'])) >= ACCOUNT_FIRST_NAME) { $data['firstname'] = $_POST['firstname']; } else { $lC_MessageStack->add($this->_module, sprintf($lC_Language->get('field_customer_first_name_error'), ACCOUNT_FIRST_NAME)); } if (isset($_POST['lastname']) && strlen(trim($_POST['lastname'])) >= ACCOUNT_LAST_NAME) { $data['lastname'] = $_POST['lastname']; } else { $lC_MessageStack->add($this->_module, sprintf($lC_Language->get('field_customer_last_name_error'), ACCOUNT_LAST_NAME)); } if (isset($_POST['newsletter']) && $_POST['newsletter'] == '1') { $data['newsletter'] = 1; } else { $data['newsletter'] = ''; } if (ACCOUNT_DATE_OF_BIRTH == '1') { if (isset($_POST['dob']) && $_POST['dob'] != NULL) { $dateParts = explode("/", $_POST['dob']); } else { $dateParts = array($_POST['dob_days'], $_POST['dob_months'], $_POST['dob_years']); } if (isset($dateParts[1]) && isset($dateParts[0]) && isset($dateParts[2]) && checkdate($dateParts[0], $dateParts[1], $dateParts[2])) { $data['dob'] = @mktime(0, 0, 0, $dateParts[0], $dateParts[1], $dateParts[2]); } else { $lC_MessageStack->add($this->_module, $lC_Language->get('field_customer_date_of_birth_error')); } } if (isset($_POST['email_address']) && strlen(trim($_POST['email_address'])) >= ACCOUNT_EMAIL_ADDRESS) { if (lc_validate_email_address($_POST['email_address'])) { if (lC_Account::checkDuplicateEntry($_POST['email_address']) === false) { $data['email_address'] = $_POST['email_address']; } else { $lC_MessageStack->add($this->_module, $lC_Language->get('field_customer_email_address_exists_error')); } } else { $lC_MessageStack->add($this->_module, $lC_Language->get('field_customer_email_address_check_error')); } } else { $lC_MessageStack->add($this->_module, sprintf($lC_Language->get('field_customer_email_address_error'), ACCOUNT_EMAIL_ADDRESS)); } if (isset($_POST['password']) === false || isset($_POST['password']) && strlen(trim($_POST['password'])) < ACCOUNT_PASSWORD) { $lC_MessageStack->add($this->_module, sprintf($lC_Language->get('field_customer_password_error'), ACCOUNT_PASSWORD)); } elseif (isset($_POST['confirmation']) === false || isset($_POST['confirmation']) && trim($_POST['password']) != trim($_POST['confirmation'])) { $lC_MessageStack->add($this->_module, $lC_Language->get('field_customer_password_mismatch_with_confirmation')); } else { $data['password'] = $_POST['password']; } if ($lC_MessageStack->size($this->_module) === 0) { if (lC_Account::createEntry($data)) { $lC_MessageStack->add('create', $lC_Language->get('success_account_updated'), 'success'); } // added to redirect to keep customer in checkout stream foreach ($_SESSION['lC_NavigationHistory_data'] as $data) { foreach ($data as $page) { foreach ($page as $key => $value) { if ($key == 'shipping') { $checkout = true; } } } } if ($checkout == true) { lc_redirect(lc_href_link(FILENAME_CHECKOUT, 'shipping&account_created=true', 'SSL')); } else { lc_redirect(lc_href_link(FILENAME_ACCOUNT, 'create=success', 'SSL')); } } }