本文整理汇总了PHP中osc_validate_email_address函数的典型用法代码示例。如果您正苦于以下问题:PHP osc_validate_email_address函数的具体用法?PHP osc_validate_email_address怎么用?PHP osc_validate_email_address使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osc_validate_email_address函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public static function execute(ApplicationAbstract $application)
{
$OSCOM_MessageStack = Registry::get('MessageStack');
$data = array();
if (DISPLAY_PRIVACY_CONDITIONS == '1') {
if (isset($_POST['privacy_conditions']) === false || isset($_POST['privacy_conditions']) && $_POST['privacy_conditions'] != '1') {
$OSCOM_MessageStack->add('Create', OSCOM::getDef('error_privacy_statement_not_accepted'));
}
}
if (ACCOUNT_GENDER >= 0) {
if (isset($_POST['gender']) && ($_POST['gender'] == 'm' || $_POST['gender'] == 'f')) {
$data['gender'] = $_POST['gender'];
} else {
$OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_gender_error'));
}
}
if (isset($_POST['firstname']) && strlen(trim($_POST['firstname'])) >= ACCOUNT_FIRST_NAME) {
$data['firstname'] = $_POST['firstname'];
} else {
$OSCOM_MessageStack->add('Create', sprintf(OSCOM::getDef('field_customer_first_name_error'), ACCOUNT_FIRST_NAME));
}
if (isset($_POST['lastname']) && strlen(trim($_POST['lastname'])) >= ACCOUNT_LAST_NAME) {
$data['lastname'] = $_POST['lastname'];
} else {
$OSCOM_MessageStack->add('Create', sprintf(OSCOM::getDef('field_customer_last_name_error'), ACCOUNT_LAST_NAME));
}
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'])) {
$data['dob'] = mktime(0, 0, 0, $_POST['dob_months'], $_POST['dob_days'], $_POST['dob_years']);
} else {
$OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_date_of_birth_error'));
}
}
if (isset($_POST['email_address']) && strlen(trim($_POST['email_address'])) >= ACCOUNT_EMAIL_ADDRESS) {
if (osc_validate_email_address($_POST['email_address'])) {
if (Account::checkEntry($_POST['email_address']) === false) {
$data['email_address'] = $_POST['email_address'];
} else {
$OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_email_address_exists_error'));
}
} else {
$OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_email_address_check_error'));
}
} else {
$OSCOM_MessageStack->add('Create', sprintf(OSCOM::getDef('field_customer_email_address_error'), ACCOUNT_EMAIL_ADDRESS));
}
if (isset($_POST['password']) === false || isset($_POST['password']) && strlen(trim($_POST['password'])) < ACCOUNT_PASSWORD) {
$OSCOM_MessageStack->add('Create', sprintf(OSCOM::getDef('field_customer_password_error'), ACCOUNT_PASSWORD));
} elseif (isset($_POST['confirmation']) === false || isset($_POST['confirmation']) && trim($_POST['password']) != trim($_POST['confirmation'])) {
$OSCOM_MessageStack->add('Create', OSCOM::getDef('field_customer_password_mismatch_with_confirmation'));
} else {
$data['password'] = $_POST['password'];
}
if ($OSCOM_MessageStack->size('Create') === 0) {
if (Account::createEntry($data)) {
$OSCOM_MessageStack->add('Create', OSCOM::getDef('success_account_updated'), 'success');
}
osc_redirect(OSCOM::getLink(null, null, 'Create&Success', 'SSL'));
}
}
示例2: _process
function _process()
{
global $osC_Language, $messageStack, $osC_Product;
if (empty($_POST['from_name'])) {
$messageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_customers_name_empty'));
}
if (!osc_validate_email_address($_POST['from_email_address'])) {
$messageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_invalid_customers_email_address'));
}
if (empty($_POST['to_name'])) {
$messageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_friends_name_empty'));
}
if (!osc_validate_email_address($_POST['to_email_address'])) {
$messageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_invalid_friends_email_address'));
}
if ($messageStack->size('tell_a_friend') < 1) {
include 'includes/classes/email_template.php';
$email_template = toC_Email_Template::getEmailTemplate('tell_a_friend');
$email_template->setData($_POST['from_name'], $_POST['from_email_address'], $_POST['to_name'], $_POST['to_email_address'], $_POST['message'], $osC_Product->getTitle(), osc_href_link(FILENAME_PRODUCTS, $osC_Product->getID(), 'NONSSL', false, true, true));
$email_template->buildMessage();
$email_template->sendEmail();
$messageStack->add_session('header', sprintf($osC_Language->get('success_tell_a_friend_email_sent'), $osC_Product->getTitle(), osc_output_string_protected($_POST['to_name'])), 'success');
osc_redirect(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getID()));
}
}
示例3: _process
function _process()
{
global $osC_Language, $osC_MessageStack, $osC_Product;
if (empty($_POST['from_name'])) {
$osC_MessageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_customers_name_empty'));
}
if (!osc_validate_email_address($_POST['from_email_address'])) {
$osC_MessageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_invalid_customers_email_address'));
}
if (empty($_POST['to_name'])) {
$osC_MessageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_friends_name_empty'));
}
if (!osc_validate_email_address($_POST['to_email_address'])) {
$osC_MessageStack->add('tell_a_friend', $osC_Language->get('error_tell_a_friend_invalid_friends_email_address'));
}
if ($osC_MessageStack->size('tell_a_friend') < 1) {
$email_subject = sprintf($osC_Language->get('email_tell_a_friend_subject'), osc_sanitize_string($_POST['from_name']), STORE_NAME);
$email_body = sprintf($osC_Language->get('email_tell_a_friend_intro'), osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['from_name']), $osC_Product->getTitle(), STORE_NAME) . "\n\n";
if (!empty($_POST['message'])) {
$email_body .= osc_sanitize_string($_POST['message']) . "\n\n";
}
$email_body .= sprintf($osC_Language->get('email_tell_a_friend_link'), osc_href_link(FILENAME_PRODUCTS, $osC_Product->getKeyword(), 'NONSSL', false)) . "\n\n" . sprintf($osC_Language->get('email_tell_a_friend_signature'), STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n");
osc_email(osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['to_email_address']), $email_subject, $email_body, osc_sanitize_string($_POST['from_name']), osc_sanitize_string($_POST['from_email_address']));
$osC_MessageStack->add('header', sprintf($osC_Language->get('success_tell_a_friend_email_sent'), $osC_Product->getTitle(), osc_output_string_protected($_POST['to_name'])), 'success');
osc_redirect(osc_href_link(FILENAME_PRODUCTS, $osC_Product->getID()));
}
}
示例4: getPassword
function getPassword()
{
global $toC_Json, $osC_Language, $osC_Database;
$error = false;
$feedback = '';
$email = $_REQUEST['email_address'];
if (!osc_validate_email_address($email)) {
$error = true;
$feedback = $osC_Language->get('ms_error_wrong_email_address');
} else {
if (!osC_Administrators_Admin::checkEmail($email)) {
$error = true;
$feedback = $osC_Language->get('ms_error_email_not_exist');
}
}
if ($error === false) {
if (!osC_Administrators_Admin::generatePassword($email)) {
$error = true;
$feedback = $osC_Language->get('ms_error_email_send_failure');
}
}
if ($error == false) {
$response = array('success' => true, 'feedback' => $osC_Language->get('ms_success_action_performed'));
} else {
$response = array('success' => false, 'feedback' => $feedback);
}
echo $toC_Json->encode($response);
}
示例5: _process
function _process()
{
global $messageStack, $osC_Database, $osC_Language, $osC_Customer;
$data = array();
$j_to_g = array();
if (ACCOUNT_GENDER == '1') {
if (isset($_POST['gender']) && ($_POST['gender'] == 'm' || $_POST['gender'] == 'f')) {
$data['gender'] = $_POST['gender'];
} else {
$messageStack->add($this->_module, $osC_Language->get('field_customer_gender_error'));
}
} else {
$data['gender'] = isset($_POST['gender']) ? $_POST['gender'] : '';
}
if (isset($_POST['firstname']) && strlen(trim($_POST['firstname'])) >= ACCOUNT_FIRST_NAME) {
$data['firstname'] = $_POST['firstname'];
} else {
$messageStack->add('account_edit', sprintf($osC_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 {
$messageStack->add('account_edit', sprintf($osC_Language->get('field_customer_last_name_error'), ACCOUNT_LAST_NAME));
}
if (ACCOUNT_DATE_OF_BIRTH == '1') {
if (isset($_POST['dob_days']) && isset($_POST['dob_months']) && isset($_POST['dob_years']) && jcheckdate($_POST['dob_months'], $_POST['dob_days'], $_POST['dob_years'])) {
$j_to_g = jalali_to_gregorian($_POST['dob_years'], $_POST['dob_months'], $_POST['dob_days']);
// tabdil shamsi be miladi
$data['dob'] = mktime(0, 0, 0, $j_to_g['1'], $j_to_g['2'], $j_to_g['0']);
} else {
$messageStack->add('account_edit', $osC_Language->get('field_customer_date_of_birth_error'));
}
}
if (isset($_POST['email_address']) && strlen(trim($_POST['email_address'])) >= ACCOUNT_EMAIL_ADDRESS) {
if (osc_validate_email_address($_POST['email_address'])) {
if (osC_Account::checkDuplicateEntry($_POST['email_address']) === false) {
$data['email_address'] = $_POST['email_address'];
} else {
$messageStack->add('account_edit', $osC_Language->get('field_customer_email_address_exists_error'));
}
} else {
$messageStack->add('account_edit', $osC_Language->get('field_customer_email_address_check_error'));
}
} else {
$messageStack->add('account_edit', sprintf($osC_Language->get('field_customer_email_address_error'), ACCOUNT_EMAIL_ADDRESS));
}
if ($messageStack->size('account_edit') === 0) {
if (osC_Account::saveEntry($data)) {
// reset the session variables
if (ACCOUNT_GENDER > -1) {
$osC_Customer->setGender($data['gender']);
}
$osC_Customer->setFirstName(trim($data['firstname']));
$osC_Customer->setLastName(trim($data['lastname']));
$osC_Customer->setEmailAddress($data['email_address']);
$messageStack->add_session('account', $osC_Language->get('success_account_updated'), 'success');
}
osc_redirect(osc_href_link(FILENAME_ACCOUNT, null, 'SSL'));
}
}
示例6: _process
function _process()
{
global $osC_MessageStack, $osC_Database, $osC_Language, $osC_Customer;
$data = array();
if (DISPLAY_PRIVACY_CONDITIONS == '1') {
if (isset($_POST['privacy_conditions']) === false || isset($_POST['privacy_conditions']) && $_POST['privacy_conditions'] != '1') {
$osC_MessageStack->add($this->_module, $osC_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 {
$osC_MessageStack->add($this->_module, $osC_Language->get('field_customer_gender_error'));
}
}
if (isset($_POST['firstname']) && strlen(trim($_POST['firstname'])) >= ACCOUNT_FIRST_NAME) {
$data['firstname'] = $_POST['firstname'];
} else {
$osC_MessageStack->add($this->_module, sprintf($osC_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 {
$osC_MessageStack->add($this->_module, sprintf($osC_Language->get('field_customer_last_name_error'), ACCOUNT_LAST_NAME));
}
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'])) {
$data['dob'] = mktime(0, 0, 0, $_POST['dob_months'], $_POST['dob_days'], $_POST['dob_years']);
} else {
$osC_MessageStack->add($this->_module, $osC_Language->get('field_customer_date_of_birth_error'));
}
}
if (isset($_POST['email_address']) && strlen(trim($_POST['email_address'])) >= ACCOUNT_EMAIL_ADDRESS) {
if (osc_validate_email_address($_POST['email_address'])) {
if (osC_Account::checkDuplicateEntry($_POST['email_address']) === false) {
$data['email_address'] = $_POST['email_address'];
} else {
$osC_MessageStack->add($this->_module, $osC_Language->get('field_customer_email_address_exists_error'));
}
} else {
$osC_MessageStack->add($this->_module, $osC_Language->get('field_customer_email_address_check_error'));
}
} else {
$osC_MessageStack->add($this->_module, sprintf($osC_Language->get('field_customer_email_address_error'), ACCOUNT_EMAIL_ADDRESS));
}
if (isset($_POST['password']) === false || isset($_POST['password']) && strlen(trim($_POST['password'])) < ACCOUNT_PASSWORD) {
$osC_MessageStack->add($this->_module, sprintf($osC_Language->get('field_customer_password_error'), ACCOUNT_PASSWORD));
} elseif (isset($_POST['confirmation']) === false || isset($_POST['confirmation']) && trim($_POST['password']) != trim($_POST['confirmation'])) {
$osC_MessageStack->add($this->_module, $osC_Language->get('field_customer_password_mismatch_with_confirmation'));
} else {
$data['password'] = $_POST['password'];
}
if ($osC_MessageStack->size($this->_module) === 0) {
if (osC_Account::createEntry($data)) {
$osC_MessageStack->add('create', $osC_Language->get('success_account_updated'), 'success');
}
osc_redirect(osc_href_link(FILENAME_ACCOUNT, 'create=success', 'SSL'));
}
}
示例7: _process
function _process()
{
global $osC_Database, $messageStack, $osC_Language;
$data = array();
$data['url'] = osc_sanitize_string($_POST['url']);
if (isset($_POST['title']) && !empty($_POST['title'])) {
$data['title'] = osc_sanitize_string($_POST['title']);
} else {
$messageStack->add('guestbook', $osC_Language->get('field_guestbook_title_error'));
}
if (isset($_POST['email']) && !empty($_POST['email']) && osc_validate_email_address($_POST['email'])) {
$data['email'] = $_POST['email'];
} else {
$messageStack->add('guestbook', $osC_Language->get('field_guestbook_email_error'));
}
if (isset($_POST['content']) && !empty($_POST['content'])) {
$data['content'] = osc_sanitize_string($_POST['content']);
} else {
$messageStack->add('guestbook', $osC_Language->get('field_guestbook_content_error'));
}
if ($_POST['verify_code'] != $_SESSION['verify_code']) {
$messageStack->add('guestbook', $osC_Language->get('field_guestbook_verify_code_error'));
}
if ($messageStack->size('guestbook') === 0) {
if (toC_Guestbook::saveEntry($data)) {
$messageStack->add_session('guestbook', $osC_Language->get('success_guestbook_saved'), 'success');
}
osc_redirect(osc_href_link(FILENAME_INFO, 'guestbook'));
}
}
示例8: execute
public static function execute(ApplicationAbstract $application)
{
$OSCOM_Customer = Registry::get('Customer');
$OSCOM_NavigationHistory = Registry::get('NavigationHistory');
$OSCOM_MessageStack = Registry::get('MessageStack');
$OSCOM_Service = Registry::get('Service');
$OSCOM_Breadcrumb = Registry::get('Breadcrumb');
if (ALLOW_GUEST_TO_TELL_A_FRIEND == '-1' && $OSCOM_Customer->isLoggedOn() === false) {
$OSCOM_NavigationHistory->setSnapshot();
osc_redirect(OSCOM::getLink(null, 'Account', 'LogIn', 'SSL'));
}
$requested_product = null;
$product_check = false;
if (count($_GET) > 3) {
$requested_product = basename(key(array_slice($_GET, 3, 1, true)));
if ($requested_product == 'Write') {
unset($requested_product);
if (count($_GET) > 4) {
$requested_product = basename(key(array_slice($_GET, 4, 1, true)));
}
}
}
if (isset($requested_product)) {
if (Product::checkEntry($requested_product)) {
$product_check = true;
}
}
if ($product_check === false) {
$application->setPageContent('not_found.php');
return false;
}
Registry::set('Product', new Product($requested_product));
$OSCOM_Product = Registry::get('Product');
if (empty($_POST['from_name'])) {
$OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_customers_name_empty'));
}
if (!osc_validate_email_address($_POST['from_email_address'])) {
$OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_invalid_customers_email_address'));
}
if (empty($_POST['to_name'])) {
$OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_friends_name_empty'));
}
if (!osc_validate_email_address($_POST['to_email_address'])) {
$OSCOM_MessageStack->add('TellAFriend', OSCOM::getDef('error_tell_a_friend_invalid_friends_email_address'));
}
if ($OSCOM_MessageStack->size('TellAFriend') < 1) {
$email_subject = sprintf(OSCOM::getDef('email_tell_a_friend_subject'), osc_sanitize_string($_POST['from_name']), STORE_NAME);
$email_body = sprintf(OSCOM::getDef('email_tell_a_friend_intro'), osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['from_name']), $OSCOM_Product->getTitle(), STORE_NAME) . "\n\n";
if (!empty($_POST['message'])) {
$email_body .= osc_sanitize_string($_POST['message']) . "\n\n";
}
$email_body .= sprintf(OSCOM::getDef('email_tell_a_friend_link'), OSCOM::getLink(null, null, $OSCOM_Product->getKeyword(), 'NONSSL', false)) . "\n\n" . sprintf(OSCOM::getDef('email_tell_a_friend_signature'), STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n");
osc_email(osc_sanitize_string($_POST['to_name']), osc_sanitize_string($_POST['to_email_address']), $email_subject, $email_body, osc_sanitize_string($_POST['from_name']), osc_sanitize_string($_POST['from_email_address']));
$OSCOM_MessageStack->add('header', sprintf(OSCOM::getDef('success_tell_a_friend_email_sent'), $OSCOM_Product->getTitle(), osc_output_string_protected($_POST['to_name'])), 'success');
osc_redirect(OSCOM::getLink(null, null, $OSCOM_Product->getKeyword()));
}
$application->setPageTitle($OSCOM_Product->getTitle());
$application->setPageContent('tell_a_friend.php');
}
示例9: process
protected function process()
{
$OSCOM_ShoppingCart = Registry::get('ShoppingCart');
$OSCOM_Customer = Registry::get('Customer');
$OSCOM_Language = Registry::get('Language');
$OSCOM_Service = Registry::get('Service');
$OSCOM_Breadcrumb = Registry::get('Breadcrumb');
$OSCOM_MessageStack = Registry::get('MessageStack');
// redirect to shopping cart if shopping cart is empty
if (!$OSCOM_ShoppingCart->hasContents()) {
osc_redirect(OSCOM::getLink(null, 'Cart'));
}
// check for e-mail address
if (!$OSCOM_Customer->hasEmailAddress()) {
if (isset($_POST['email']) && strlen(trim($_POST['email'])) >= ACCOUNT_EMAIL_ADDRESS) {
if (osc_validate_email_address($_POST['email'])) {
$OSCOM_Customer->setEmailAddress(trim($_POST['email']));
} else {
$OSCOM_MessageStack->add('Cart', OSCOM::getDef('field_customer_email_address_check_error'));
osc_redirect(OSCOM::getLink(null, 'Cart'));
}
} else {
$OSCOM_MessageStack->add('Cart', sprintf(OSCOM::getDef('field_customer_email_address_error'), ACCOUNT_EMAIL_ADDRESS));
osc_redirect(OSCOM::getLink(null, 'Cart'));
}
}
// check product type perform_order conditions
foreach ($OSCOM_ShoppingCart->getProducts() as $product) {
$OSCOM_Product = new Product($product['id']);
$OSCOM_Product->isTypeActionAllowed('PerformOrder');
}
$OSCOM_Language->load('checkout');
$OSCOM_Language->load('order');
$this->_page_title = OSCOM::getDef('confirmation_heading');
if ($OSCOM_Service->isStarted('Breadcrumb')) {
$OSCOM_Breadcrumb->add(OSCOM::getDef('breadcrumb_checkout_confirmation'), OSCOM::getLink(null, 'Checkout', null, 'SSL'));
}
if (isset($_POST['comments']) && isset($_SESSION['comments']) && empty($_POST['comments'])) {
unset($_SESSION['comments']);
} elseif (!empty($_POST['comments'])) {
$_SESSION['comments'] = osc_sanitize_string($_POST['comments']);
}
if (DISPLAY_CONDITIONS_ON_CHECKOUT == '1') {
if (!isset($_POST['conditions']) || $_POST['conditions'] != '1') {
$OSCOM_MessageStack->add('Checkout', OSCOM::getDef('error_conditions_not_accepted'), 'error');
}
}
if (Registry::exists('Payment') === false) {
Registry::set('Payment', new Payment());
}
if ($OSCOM_ShoppingCart->hasBillingMethod()) {
$OSCOM_Payment = Registry::get('Payment');
$OSCOM_Payment->load($OSCOM_ShoppingCart->getBillingMethod('id'));
}
}
示例10: execute
public static function execute(ApplicationAbstract $application)
{
$OSCOM_MessageStack = Registry::get('MessageStack');
$name = osc_sanitize_string($_POST['name']);
$email_address = osc_sanitize_string($_POST['email']);
$enquiry = osc_sanitize_string($_POST['enquiry']);
if (osc_validate_email_address($email_address)) {
osc_email(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, OSCOM::getDef('contact_email_subject'), $enquiry, $name, $email_address);
osc_redirect(OSCOM::getLink(null, null, 'Contact&Success'));
} else {
$OSCOM_MessageStack->add('Contact', OSCOM::getDef('field_customer_email_address_check_error'));
}
}
示例11: _process
function _process()
{
global $osC_Language, $osC_MessageStack;
$name = osc_sanitize_string($_POST['name']);
$email_address = osc_sanitize_string($_POST['email']);
$enquiry = osc_sanitize_string($_POST['enquiry']);
if (osc_validate_email_address($email_address)) {
osc_email(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $osC_Language->get('contact_email_subject'), $enquiry, $name, $email_address);
osc_redirect(osc_href_link(FILENAME_INFO, 'contact=success', 'AUTO'));
} else {
$osC_MessageStack->add('contact', $osC_Language->get('field_customer_email_address_check_error'));
}
}
示例12: setData
function setData($from_name, $from_email_address, $to_email_address, $message, $wishlist_url)
{
$this->_from_name = $from_name;
$this->_from_email_address = $from_email_address;
$this->_to_email_address = $to_email_address;
$this->_message = $message;
$this->_wishlist_url = $wishlist_url;
$emails = explode(',', $this->_to_email_address);
foreach ($emails as $email) {
if (osc_validate_email_address($email)) {
$this->addRecipient('', $email);
}
}
}
示例13: _process
function _process()
{
global $osC_Language, $messageStack;
if (isset($_POST['department_email']) && !empty($_POST['department_email'])) {
$department_email = osc_sanitize_string($_POST['department_email']);
if (!osc_validate_email_address($department_email)) {
$messageStack->add('contact', $osC_Language->get('field_departments_email_error'));
}
} else {
$department_email = STORE_OWNER_EMAIL_ADDRESS;
}
if (isset($_POST['name']) && !empty($_POST['name'])) {
$name = osc_sanitize_string($_POST['name']);
} else {
$messageStack->add('contact', $osC_Language->get('field_customer_name_error'));
}
if (isset($_POST['email']) && !empty($_POST['email'])) {
$email_address = osc_sanitize_string($_POST['email']);
if (!osc_validate_email_address($email_address)) {
$messageStack->add('contact', $osC_Language->get('field_customer_concat_email_error'));
}
} else {
$messageStack->add('contact', $osC_Language->get('field_customer_concat_email_error'));
}
if (isset($_POST['telephone']) && !empty($_POST['telephone'])) {
$telephone = osc_sanitize_string($_POST['telephone']);
}
if (isset($_POST['enquiry']) && !empty($_POST['enquiry'])) {
$enquiry = osc_sanitize_string($_POST['enquiry']);
} else {
$messageStack->add('contact', $osC_Language->get('field_enquiry_error'));
}
if (ACTIVATE_CAPTCHA == '1') {
if (isset($_POST['captcha_code']) && !empty($_POST['captcha_code'])) {
$securimage = new Securimage();
if ($securimage->check($_POST['captcha_code']) == false) {
$messageStack->add('contact', $osC_Language->get('field_concat_captcha_check_error'));
}
} else {
$messageStack->add('contact', $osC_Language->get('field_concat_captcha_check_error'));
}
}
if ($messageStack->size('contact') === 0) {
osc_email(STORE_OWNER, $department_email, $osC_Language->get('contact_email_subject'), $enquiry . '<br /><br /><br />' . $osC_Language->get('contact_telephone_title') . $telephone, $name, $email_address);
osc_redirect(osc_href_link(FILENAME_INFO, 'contact=success', 'AUTO', true, false));
}
}
示例14: addProduct
function addProduct()
{
global $toC_Json, $osC_Language, $osC_Tax, $osC_Weight, $osC_Currencies, $osC_ShoppingCart;
$error = false;
$feedback = array();
$osC_ShoppingCart = new toC_ShoppingCart_Adapter($_REQUEST['orders_id']);
$osC_Tax = new osC_Tax_Admin();
$osC_Weight = new osC_Weight();
$osC_Currencies = new osC_Currencies();
$osC_Product = new osC_Product(osc_get_product_id($_REQUEST['products_id']));
$gift_certificate_data = null;
if ($osC_Product->isGiftCertificate()) {
if (!isset($_REQUEST['senders_name']) || empty($_REQUEST['senders_name'])) {
$error = true;
$feedback[] = $osC_Language->get('error_sender_name_empty');
}
if (!isset($_REQUEST['recipients_name']) || empty($_REQUEST['recipients_name'])) {
$error = true;
$feedback[] = $osC_Language->get('error_recipients_name_empty');
}
if (!isset($_REQUEST['message']) || empty($_REQUEST['message'])) {
$error = true;
$feedback[] = $osC_Language->get('error_message_empty');
}
if ($osC_Product->isEmailGiftCertificate()) {
if (!isset($_REQUEST['senders_email']) || empty($_REQUEST['senders_email'])) {
$error = true;
$feedback[] = $osC_Language->get('error_sender_email_empty');
}
if (!osc_validate_email_address($_REQUEST['senders_email'])) {
$error = true;
$feedback[] = $osC_Language->get('error_sender_email_invalid');
}
if (!isset($_REQUEST['recipients_email']) || empty($_REQUEST['recipients_email'])) {
$error = true;
$feedback[] = $osC_Language->get('error_recipients_email_empty');
}
if (!osc_validate_email_address($_REQUEST['recipients_email'])) {
$error = true;
$feedback[] = $osC_Language->get('error_recipients_email_invalid');
}
}
if ($error === false) {
if ($osC_Product->isEmailGiftCertificate()) {
$gift_certificate_data = array('senders_name' => $_REQUEST['senders_name'], 'senders_email' => $_REQUEST['senders_email'], 'recipients_name' => $_REQUEST['recipients_name'], 'recipients_email' => $_REQUEST['recipients_email'], 'message' => $_REQUEST['message']);
} else {
$gift_certificate_data = array('senders_name' => $_REQUEST['senders_name'], 'recipients_name' => $_REQUEST['recipients_name'], 'message' => $_REQUEST['message']);
}
$gift_certificate_data['type'] = $osC_Product->getGiftCertificateType();
if ($osC_Product->isOpenAmountGiftCertificate()) {
$gift_certificate_data['price'] = $_REQUEST['gift_certificate_amount'] / $osC_ShoppingCart->getCurrencyValue();
}
}
}
if ($error === false) {
if ($osC_ShoppingCart->addProduct($_REQUEST['products_id'], $_REQUEST['new_qty'], $gift_certificate_data)) {
$response = array('success' => true, 'feedback' => $osC_Language->get('ms_success_action_performed'));
} else {
$response = array('success' => false, 'feedback' => $osC_Language->get('ms_error_action_not_performed'));
}
} else {
$response = array('success' => false, 'feedback' => implode('<br />', $feedback));
}
echo $toC_Json->encode($response);
}
示例15: _process
function _process()
{
global $messageStack, $osC_Database, $osC_Language, $osC_Customer;
$data = array();
$j_to_g = array();
if (DISPLAY_PRIVACY_CONDITIONS == '1') {
if (isset($_POST['privacy_conditions']) === false || isset($_POST['privacy_conditions']) && $_POST['privacy_conditions'] != '1') {
$messageStack->add($this->_module, $osC_Language->get('error_privacy_statement_not_accepted'));
}
}
if (ACCOUNT_GENDER == '1') {
if (isset($_POST['gender']) && ($_POST['gender'] == 'm' || $_POST['gender'] == 'f')) {
$data['gender'] = $_POST['gender'];
} else {
$messageStack->add($this->_module, $osC_Language->get('field_customer_gender_error'));
}
} else {
$data['gender'] = isset($_POST['gender']) ? $_POST['gender'] : '';
}
if (isset($_POST['firstname']) && strlen(trim($_POST['firstname'])) >= ACCOUNT_FIRST_NAME) {
$data['firstname'] = $_POST['firstname'];
} else {
$messageStack->add($this->_module, sprintf($osC_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 {
$messageStack->add($this->_module, sprintf($osC_Language->get('field_customer_last_name_error'), ACCOUNT_LAST_NAME));
}
$data['newsletter'] = isset($_POST['newsletter']) && $_POST['newsletter'] == '1' ? 1 : 0;
if (ACCOUNT_DATE_OF_BIRTH == '1') {
if (isset($_POST['dob_days']) && isset($_POST['dob_months']) && isset($_POST['dob_years']) && jcheckdate($_POST['dob_months'], $_POST['dob_days'], $_POST['dob_years'])) {
$j_to_g = jalali_to_gregorian($_POST['dob_years'], $_POST['dob_months'], $_POST['dob_days']);
// tabdil shamsi be miladi
$data['dob'] = mktime(0, 0, 0, $j_to_g['1'], $j_to_g['2'], $j_to_g['0']);
} else {
$messageStack->add($this->_module, $osC_Language->get('field_customer_date_of_birth_error'));
}
}
if (isset($_POST['email_address']) && strlen(trim($_POST['email_address'])) >= ACCOUNT_EMAIL_ADDRESS) {
if (osc_validate_email_address($_POST['email_address'])) {
if (osC_Account::checkDuplicateEntry($_POST['email_address']) === false) {
$data['email_address'] = $_POST['email_address'];
} else {
$messageStack->add($this->_module, $osC_Language->get('field_customer_email_address_exists_error'));
}
} else {
$messageStack->add($this->_module, $osC_Language->get('field_customer_email_address_check_error'));
}
} else {
$messageStack->add($this->_module, sprintf($osC_Language->get('field_customer_email_address_error'), ACCOUNT_EMAIL_ADDRESS));
}
if (isset($_POST['password']) === false || isset($_POST['password']) && strlen(trim($_POST['password'])) < ACCOUNT_PASSWORD) {
$messageStack->add($this->_module, sprintf($osC_Language->get('field_customer_password_error'), ACCOUNT_PASSWORD));
} elseif (isset($_POST['confirmation']) === false || isset($_POST['confirmation']) && trim($_POST['password']) != trim($_POST['confirmation'])) {
$messageStack->add($this->_module, $osC_Language->get('field_customer_password_mismatch_with_confirmation'));
} else {
$data['password'] = $_POST['password'];
}
if (ACTIVATE_CAPTCHA == '1') {
if (isset($_POST['captcha_code']) && !empty($_POST['captcha_code'])) {
$securimage = new Securimage();
if ($securimage->check($_POST['captcha_code']) == false) {
$messageStack->add('create', $osC_Language->get('field_create_account_captcha_check_error'));
}
} else {
$messageStack->add('create', $osC_Language->get('field_create_account_captcha_check_error'));
}
}
if ($messageStack->size($this->_module) === 0) {
if (osC_Account::createEntry($data)) {
$messageStack->add_session('create', $osC_Language->get('success_account_updated'), 'success');
}
osc_redirect(osc_href_link(FILENAME_ACCOUNT, 'create=success', 'SSL'));
}
}