public function execute() { global $login_customer_id; $OSCOM_Db = Registry::get('Db'); if (is_int($login_customer_id) && $login_customer_id > 0) { if (SESSION_RECREATE == 'True') { tep_session_recreate(); } $Qcustomer = $OSCOM_Db->prepare('select c.customers_firstname, c.customers_default_address_id, ab.entry_country_id, ab.entry_zone_id from :table_customers c left join :table_address_book ab on (c.customers_id = ab.customers_id and c.customers_default_address_id = ab.address_book_id) where c.customers_id = :customers_id'); $Qcustomer->bindInt(':customers_id', $login_customer_id); $Qcustomer->execute(); $_SESSION['customer_id'] = $login_customer_id; $_SESSION['customer_default_address_id'] = $Qcustomer->valueInt('customers_default_address_id'); $_SESSION['customer_first_name'] = $Qcustomer->value('customers_firstname'); $_SESSION['customer_country_id'] = $Qcustomer->valueInt('entry_country_id'); $_SESSION['customer_zone_id'] = $Qcustomer->valueInt('entry_zone_id'); $Qupdate = $OSCOM_Db->prepare('update :table_customers_info set customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1, password_reset_key = null, password_reset_date = null where customers_info_id = :customers_info_id'); $Qupdate->bindInt(':customers_info_id', $_SESSION['customer_id']); $Qupdate->execute(); // reset session token $_SESSION['sessiontoken'] = md5(tep_rand() . tep_rand() . tep_rand() . tep_rand()); // restore cart contents $_SESSION['cart']->restore_contents(); if (count($_SESSION['navigation']->snapshot) > 0) { $origin_href = OSCOM::link($_SESSION['navigation']->snapshot['page'], tep_array_to_string($_SESSION['navigation']->snapshot['get'], array(session_name())), $_SESSION['navigation']->snapshot['mode']); $_SESSION['navigation']->clear_snapshot(); HTTP::redirect($origin_href); } OSCOM::redirect('index.php'); } }
function tep_session_start() { $sane_session_id = true; if (isset($_GET[session_name()])) { if (SESSION_FORCE_COOKIE_USE == 'True' || preg_match('/^[a-zA-Z0-9,-]+$/', $_GET[session_name()]) == false) { unset($_GET[session_name()]); $sane_session_id = false; } } if (isset($_POST[session_name()])) { if (SESSION_FORCE_COOKIE_USE == 'True' || preg_match('/^[a-zA-Z0-9,-]+$/', $_POST[session_name()]) == false) { unset($_POST[session_name()]); $sane_session_id = false; } } if (isset($_COOKIE[session_name()])) { if (preg_match('/^[a-zA-Z0-9,-]+$/', $_COOKIE[session_name()]) == false) { $session_data = session_get_cookie_params(); setcookie(session_name(), '', time() - 42000, $session_data['path'], $session_data['domain']); unset($_COOKIE[session_name()]); $sane_session_id = false; } } if ($sane_session_id == false) { OSCOM::redirect('index.php', '', 'NONSSL', false); } register_shutdown_function('session_write_close'); return session_start(); }
function execute() { global $order_id; $OSCOM_Db = Registry::get('Db'); if ((int) MODULE_CONTENT_CHECKOUT_SUCCESS_REDIRECT_OLD_ORDER_MINUTES > 0) { $Qcheck = $OSCOM_Db->prepare('select 1 from :table_orders where orders_id = :orders_id and date_purchased < date_sub(now(), interval :limit_minutes minute) limit 1'); $Qcheck->bindInt(':orders_id', $order_id); $Qcheck->bindInt(':limit_minutes', MODULE_CONTENT_CHECKOUT_SUCCESS_REDIRECT_OLD_ORDER_MINUTES); $Qcheck->execute(); if ($Qcheck->fetch() !== false) { OSCOM::redirect('account.php'); } } }
public function execute() { global $login_customer_id, $oscTemplate, $breadcrumb; $this->page->setFile('login.php'); // redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled (or the session has not started) if (session_status() !== PHP_SESSION_ACTIVE) { if (!isset($_GET['cookie_test'])) { $all_get = tep_get_all_get_params(['Account', 'LogIn', 'Process']); OSCOM::redirect('index.php', 'Account&LogIn&' . $all_get . (empty($all_get) ? '' : '&') . 'cookie_test=1', 'SSL'); } OSCOM::redirect('cookie_usage.php'); } // login content module must return $login_customer_id as an integer after successful customer authentication $login_customer_id = false; $this->page->data['content'] = $oscTemplate->getContent('login'); require OSCOM::BASE_DIR . 'languages/' . $_SESSION['language'] . '/login.php'; $breadcrumb->add(NAVBAR_TITLE, OSCOM::link('index.php', 'Account&LogIn', 'SSL')); }
public function execute() { $OSCOM_Session = Registry::get('Session'); // initialize a session token if (!isset($_SESSION['sessiontoken'])) { $_SESSION['sessiontoken'] = md5(Hash::getRandomInt() . Hash::getRandomInt() . Hash::getRandomInt() . Hash::getRandomInt()); } // verify the ssl_session_id if the feature is enabled if (HTTP::getRequestType() === 'SSL' && SESSION_CHECK_SSL_SESSION_ID == 'True' && $OSCOM_Session->hasStarted()) { if (!isset($_SESSION['SSL_SESSION_ID'])) { $_SESSION['SESSION_SSL_ID'] = $_SERVER['SSL_SESSION_ID']; } if ($_SESSION['SESSION_SSL_ID'] != $_SERVER['SSL_SESSION_ID']) { $OSCOM_Session->kill(); OSCOM::redirect('ssl_check.php'); } } // verify the browser user agent if the feature is enabled if (SESSION_CHECK_USER_AGENT == 'True') { if (!isset($_SESSION['SESSION_USER_AGENT'])) { $_SESSION['SESSION_USER_AGENT'] = $_SERVER['HTTP_USER_AGENT']; } if ($_SESSION['SESSION_USER_AGENT'] != $_SERVER['HTTP_USER_AGENT']) { $OSCOM_Session->kill(); OSCOM::redirect('login.php'); } } // verify the IP address if the feature is enabled if (SESSION_CHECK_IP_ADDRESS == 'True') { if (!isset($_SESSION['SESSION_IP_ADDRESS'])) { $_SESSION['SESSION_IP_ADDRESS'] = HTTP::getIpAddress(); } if ($_SESSION['SESSION_IP_ADDRESS'] != HTTP::getIpAddress()) { $OSCOM_Session->kill(); OSCOM::redirect('login.php'); } } }
<?php /** * osCommerce Online Merchant * * @copyright (c) 2016 osCommerce; https://www.oscommerce.com * @license MIT; https://www.oscommerce.com/license/mit.txt */ use OSC\OM\DateTime; use OSC\OM\HTML; use OSC\OM\OSCOM; use OSC\OM\Registry; require 'includes/application_top.php'; if (!isset($_GET['products_id'])) { OSCOM::redirect('index.php'); } $OSCOM_Language->loadDefinitions('product_info'); $product_exists = true; $Qproduct = $OSCOM_Db->prepare('select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from :table_products p, :table_products_description pd where p.products_id = :products_id and p.products_status = 1 and p.products_id = pd.products_id and pd.language_id = :language_id'); $Qproduct->bindInt(':products_id', $_GET['products_id']); $Qproduct->bindInt(':language_id', $OSCOM_Language->getId()); $Qproduct->execute(); $product_exists = $Qproduct->fetch() !== false; if ($product_exists === false) { header('HTTP/1.0 404 Not Found'); } elseif (!empty($Qproduct->value('products_model'))) { // add the products model to the breadcrumb trail $breadcrumb->add($Qproduct->value('products_model'), OSCOM::link('product_info.php', 'cPath=' . $cPath . '&products_id=' . $Qproduct->valueInt('products_id'))); } require $oscTemplate->getFile('template_top.php'); if ($product_exists === false) {
$Qcheck = $OSCOM_Db->prepare('select address_book_id from :table_address_book where address_book_id = :address_book_id and customers_id = :customers_id'); $Qcheck->bindInt(':address_book_id', $_SESSION['billto']); $Qcheck->bindInt(':customers_id', $_SESSION['customer_id']); $Qcheck->execute(); if ($Qcheck->fetch() !== false) { if ($reset_payment == true) { unset($_SESSION['payment']); } OSCOM::redirect('checkout_payment.php', '', 'SSL'); } else { unset($_SESSION['billto']); } // no addresses to select from - customer decided to keep the current assigned address } else { $_SESSION['billto'] = $_SESSION['customer_default_address_id']; OSCOM::redirect('checkout_payment.php', '', 'SSL'); } } // if no billing destination address was selected, use their own address as default if (!isset($_SESSION['billto'])) { $_SESSION['billto'] = $_SESSION['customer_default_address_id']; } $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('checkout_payment.php', '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2, OSCOM::link('checkout_payment_address.php', '', 'SSL')); $addresses_count = tep_count_customer_address_book_entries(); require 'includes/template_top.php'; ?> <div class="page-header"> <h1><?php echo HEADING_TITLE;
} $customerEmail = new Mail(); $customerEmail->setFrom($_POST['from']); $customerEmail->setSubject($_POST['subject']); if (!empty($_POST['message'])) { $customerEmail->setBodyPlain($_POST['message']); } if (!empty($_POST['message_html'])) { $customerEmail->setBodyHTML($_POST['message_html']); } while ($Qmail->fetch()) { $customerEmail->clearTo(); $customerEmail->addTo($Qmail->value('customers_email_address'), $Qmail->value('customers_firstname') . ' ' . $Qmail->value('customers_lastname')); $customerEmail->send(); } OSCOM::redirect(FILENAME_MAIL, 'mail_sent_to=' . urlencode($mail_sent_to)); } if ($action == 'preview' && !isset($_POST['customers_email_address'])) { $OSCOM_MessageStack->add(OSCOM::getDef('error_no_customer_selected'), 'error'); } if (isset($_GET['mail_sent_to'])) { $OSCOM_MessageStack->add(OSCOM::getDef('notice_email_sent_to', ['mail_sent_to' => $_GET['mail_sent_to']]), 'success'); } require $oscTemplate->getFile('template_top.php'); ?> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php
/* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2015 osCommerce Released under the GNU General Public License */ use OSC\OM\HTML; use OSC\OM\OSCOM; require 'includes/application_top.php'; if (!isset($_SESSION['customer_id'])) { $_SESSION['navigation']->set_snapshot(); OSCOM::redirect('login.php', '', 'SSL'); } require DIR_WS_LANGUAGES . $_SESSION['language'] . '/account_history.php'; $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('account.php', '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2, OSCOM::link('account_history.php', '', 'SSL')); require 'includes/template_top.php'; ?> <div class="page-header"> <h1><?php echo HEADING_TITLE; ?> </h1> </div> <div class="contentContainer">
if (!$actionRecorder->canPerform()) { $error = true; $actionRecorder->record(false); $messageStack->add('friend', sprintf(ERROR_ACTION_RECORDER, defined('MODULE_ACTION_RECORDER_TELL_A_FRIEND_EMAIL_MINUTES') ? (int) MODULE_ACTION_RECORDER_TELL_A_FRIEND_EMAIL_MINUTES : 15)); } if ($error == false) { $email_subject = sprintf(TEXT_EMAIL_SUBJECT, $from_name, STORE_NAME); $email_body = sprintf(TEXT_EMAIL_INTRO, $to_name, $from_name, $Qproduct->value('products_name'), STORE_NAME) . "\n\n"; if (tep_not_null($message)) { $email_body .= $message . "\n\n"; } $email_body .= sprintf(TEXT_EMAIL_LINK, OSCOM::link('product_info.php', 'products_id=' . $Qproduct->valueInt('products_id'), 'NONSSL', false)) . "\n\n" . sprintf(TEXT_EMAIL_SIGNATURE, STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n"); tep_mail($to_name, $to_email_address, $email_subject, $email_body, $from_name, $from_email_address); $actionRecorder->record(); $messageStack->add_session('header', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT, $Qproduct->value('products_name'), tep_output_string_protected($to_name)), 'success'); OSCOM::redirect('product_info.php', 'products_id=' . $Qproduct->valueInt('products_id')); } } elseif (isset($_SESSION['customer_id'])) { $Qcustomer = $OSCOM_Db->get('customers', ['customers_firstname', 'customers_lastname', 'customers_email_address'], ['customers_id' => $_SESSION['customer_id']]); $from_name = $Qcustomer->value('customers_firstname') . ' ' . $Qcustomer->value('customers_lastname'); $from_email_address = $Qcustomer->value('customers_email_address'); } $breadcrumb->add(NAVBAR_TITLE, OSCOM::link('tell_a_friend.php', 'products_id=' . $Qproduct->valueInt('products_id'))); require 'includes/template_top.php'; ?> <div class="page-header"> <h1><?php echo sprintf(HEADING_TITLE, $Qproduct->value('products_name')); ?> </h1>
// restore cart contents $_SESSION['cart']->restore_contents(); // build the message content $name = $firstname . ' ' . $lastname; if (ACCOUNT_GENDER == 'true') { if ($gender == 'm') { $email_text = sprintf(EMAIL_GREET_MR, $lastname); } else { $email_text = sprintf(EMAIL_GREET_MS, $lastname); } } else { $email_text = sprintf(EMAIL_GREET_NONE, $firstname); } $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING; tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); OSCOM::redirect('create_account_success.php', '', 'SSL'); } } $breadcrumb->add(NAVBAR_TITLE, OSCOM::link('create_account.php', '', 'SSL')); require 'includes/template_top.php'; ?> <div class="page-header"> <h1><?php echo HEADING_TITLE; ?> </h1> </div> <?php if ($messageStack->size('create_account') > 0) {
osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2015 osCommerce Released under the GNU General Public License */ use OSC\OM\HTML; use OSC\OM\OSCOM; chdir('../../../../'); require 'includes/application_top.php'; // if the customer is not logged on, redirect them to the login page if (!isset($_SESSION['customer_id'])) { $_SESSION['navigation']->set_snapshot(array('mode' => 'SSL', 'page' => 'checkout_payment.php')); OSCOM::redirect('index.php', 'Account&LogIn', 'SSL'); } if (isset($_GET['payment_error']) && tep_not_null($_GET['payment_error'])) { $redirect_url = OSCOM::link('checkout_payment.php', 'payment_error=' . $_GET['payment_error'] . (isset($_GET['error']) && tep_not_null($_GET['error']) ? '&error=' . $_GET['error'] : ''), 'SSL'); } else { $hidden_params = ''; if ($_SESSION['payment'] == 'sage_pay_direct') { $redirect_url = OSCOM::link('checkout_process.php', 'check=3D', 'SSL'); $hidden_params = HTML::hiddenField('MD', $_POST['MD']) . HTML::hiddenField('PaRes', $_POST['PaRes']); } else { $redirect_url = OSCOM::link('checkout_success.php', '', 'SSL'); } } require DIR_WS_LANGUAGES . $_SESSION['language'] . '/checkout_confirmation.php'; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
header('Content-type: application/x-octet-stream'); header('Content-disposition: attachment; filename=' . $_GET['file']); echo $buffer; exit; } } else { $OSCOM_MessageStack->add(OSCOM::getDef('error_download_link_not_acceptable'), 'error'); } break; case 'deleteconfirm': if (strstr($_GET['file'], '..')) { OSCOM::redirect(FILENAME_BACKUP); } if (unlink($backup_directory . '/' . $_GET['file'])) { $OSCOM_MessageStack->add(OSCOM::getDef('success_backup_deleted'), 'success'); OSCOM::redirect(FILENAME_BACKUP); } break; } } // check if the backup directory exists $dir_ok = false; if (is_dir($backup_directory)) { if (FileSystem::isWritable($backup_directory)) { $dir_ok = true; } else { $OSCOM_MessageStack->add(OSCOM::getDef('error_backup_directory_not_writeable'), 'error'); } } else { $OSCOM_MessageStack->add(OSCOM::getDef('error_backup_directory_does_not_exist'), 'error'); }
protected function init() { global $request_type, $cookie_domain, $cookie_path, $PHP_SELF, $SID, $currencies, $messageStack, $oscTemplate, $breadcrumb; Registry::set('Cache', new Cache()); $OSCOM_Db = Db::initialize(); Registry::set('Db', $OSCOM_Db); // set the application parameters $Qcfg = $OSCOM_Db->get('configuration', ['configuration_key as k', 'configuration_value as v']); //, null, null, null, 'configuration'); // TODO add cache when supported by admin while ($Qcfg->fetch()) { define($Qcfg->value('k'), $Qcfg->value('v')); } // set the type of request (secure or not) if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' || isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { $request_type = 'SSL'; define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG); $cookie_domain = HTTPS_COOKIE_DOMAIN; $cookie_path = HTTPS_COOKIE_PATH; } else { $request_type = 'NONSSL'; define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG); $cookie_domain = HTTP_COOKIE_DOMAIN; $cookie_path = HTTP_COOKIE_PATH; } // set php_self in the global scope $req = parse_url($_SERVER['SCRIPT_NAME']); $PHP_SELF = substr($req['path'], $request_type == 'NONSSL' ? strlen(DIR_WS_HTTP_CATALOG) : strlen(DIR_WS_HTTPS_CATALOG)); // set the session name and save path session_name('oscomid'); session_save_path(SESSION_WRITE_DIRECTORY); // set the session cookie parameters session_set_cookie_params(0, $cookie_path, $cookie_domain); if (function_exists('ini_set')) { ini_set('session.use_only_cookies', SESSION_FORCE_COOKIE_USE == 'True' ? 1 : 0); } // set the session ID if it exists if (SESSION_FORCE_COOKIE_USE == 'False') { if (isset($_GET[session_name()]) && (!isset($_COOKIE[session_name()]) || $_COOKIE[session_name()] != $_GET[session_name()])) { session_id($_GET[session_name()]); } elseif (isset($_POST[session_name()]) && (!isset($_COOKIE[session_name()]) || $_COOKIE[session_name()] != $_POST[session_name()])) { session_id($_POST[session_name()]); } } // start the session if (SESSION_FORCE_COOKIE_USE == 'True') { tep_setcookie('cookie_test', 'please_accept_for_session', time() + 60 * 60 * 24 * 30); if (isset($_COOKIE['cookie_test'])) { tep_session_start(); } } elseif (SESSION_BLOCK_SPIDERS == 'True') { $user_agent = ''; if (isset($_SERVER['HTTP_USER_AGENT'])) { $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); } $spider_flag = false; if (!empty($user_agent)) { foreach (file(OSCOM::BASE_DIR . 'spiders.txt') as $spider) { if (!empty($spider)) { if (strpos($user_agent, $spider) !== false) { $spider_flag = true; break; } } } } if ($spider_flag === false) { tep_session_start(); } } else { tep_session_start(); } $this->ignored_actions[] = session_name(); // initialize a session token if (!isset($_SESSION['sessiontoken'])) { $_SESSION['sessiontoken'] = md5(tep_rand() . tep_rand() . tep_rand() . tep_rand()); } // set SID once, even if empty $SID = defined('SID') ? SID : ''; // verify the ssl_session_id if the feature is enabled if ($request_type == 'SSL' && SESSION_CHECK_SSL_SESSION_ID == 'True' && ENABLE_SSL == true && session_status() === PHP_SESSION_ACTIVE) { if (!isset($_SESSION['SSL_SESSION_ID'])) { $_SESSION['SESSION_SSL_ID'] = $_SERVER['SSL_SESSION_ID']; } if ($_SESSION['SESSION_SSL_ID'] != $_SERVER['SSL_SESSION_ID']) { tep_session_destroy(); OSCOM::redirect('ssl_check.php'); } } // verify the browser user agent if the feature is enabled if (SESSION_CHECK_USER_AGENT == 'True') { if (!isset($_SESSION['SESSION_USER_AGENT'])) { $_SESSION['SESSION_USER_AGENT'] = $_SERVER['HTTP_USER_AGENT']; } if ($_SESSION['SESSION_USER_AGENT'] != $_SERVER['HTTP_USER_AGENT']) { tep_session_destroy(); OSCOM::redirect('index.php', 'Account&LogIn'); } } // verify the IP address if the feature is enabled if (SESSION_CHECK_IP_ADDRESS == 'True') { if (!isset($_SESSION['SESSION_IP_ADDRESS'])) { $_SESSION['SESSION_IP_ADDRESS'] = tep_get_ip_address(); } if ($_SESSION['SESSION_IP_ADDRESS'] != tep_get_ip_address()) { tep_session_destroy(); OSCOM::redirect('index.php', 'Account&LogIn'); } } // create the shopping cart if (!isset($_SESSION['cart']) || !is_object($_SESSION['cart']) || get_class($_SESSION['cart']) != 'shoppingCart') { $_SESSION['cart'] = new \shoppingCart(); } // include currencies class and create an instance $currencies = new \currencies(); // set the language if (!isset($_SESSION['language']) || isset($_GET['language'])) { $lng = new \language(); if (isset($_GET['language']) && !empty($_GET['language'])) { $lng->set_language($_GET['language']); } else { $lng->get_browser_language(); } $_SESSION['language'] = $lng->language['directory']; $_SESSION['languages_id'] = $lng->language['id']; } // include the language translations $system_locale_numeric = setlocale(LC_NUMERIC, 0); include OSCOM::BASE_DIR . 'languages/' . $_SESSION['language'] . '.php'; setlocale(LC_NUMERIC, $system_locale_numeric); // Prevent LC_ALL from setting LC_NUMERIC to a locale with 1,0 float/decimal values instead of 1.0 (see bug #634) // currency if (!isset($_SESSION['currency']) || isset($_GET['currency']) || USE_DEFAULT_LANGUAGE_CURRENCY == 'true' && LANGUAGE_CURRENCY != $_SESSION['currency']) { if (isset($_GET['currency']) && $currencies->is_set($_GET['currency'])) { $_SESSION['currency'] = $_GET['currency']; } else { $_SESSION['currency'] = USE_DEFAULT_LANGUAGE_CURRENCY == 'true' && $currencies->is_set(LANGUAGE_CURRENCY) ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY; } } // navigation history if (!isset($_SESSION['navigation']) || !is_object($_SESSION['navigation']) || get_class($_SESSION['navigation']) != 'navigationHistory') { $_SESSION['navigation'] = new \navigationHistory(); } $_SESSION['navigation']->add_current_page(); $messageStack = new \messageStack(); tep_update_whos_online(); tep_activate_banners(); tep_expire_banners(); tep_expire_specials(); $oscTemplate = new \oscTemplate(); $breadcrumb = new \breadcrumb(); $breadcrumb->add(HEADER_TITLE_TOP, HTTP_SERVER); $breadcrumb->add(HEADER_TITLE_CATALOG, OSCOM::link('index.php')); Registry::set('Hooks', new Hooks()); }
} require DIR_WS_LANGUAGES . $_SESSION['language'] . '/modules/content/account/cm_account_braintree_cards.php'; require 'includes/modules/content/account/cm_account_braintree_cards.php'; $braintree_cards = new cm_account_braintree_cards(); if (!$braintree_cards->isEnabled()) { OSCOM::redirect('account.php', '', 'SSL'); } if (isset($_GET['action'])) { if ($_GET['action'] == 'delete' && isset($_GET['id']) && is_numeric($_GET['id']) && isset($_GET['formid']) && $_GET['formid'] == md5($_SESSION['sessiontoken'])) { $Qtoken = $OSCOM_Db->get('customers_braintree_tokens', ['id', 'braintree_token'], ['id' => $_GET['id'], 'customers_id' => $_SESSION['customer_id']]); if ($Qtoken->fetch() !== false) { $braintree_cc->deleteCard($Qtoken->value('braintree_token'), $Qtoken->valueInt('id')); $messageStack->add_session('cards', MODULE_CONTENT_ACCOUNT_BRAINTREE_CARDS_SUCCESS_DELETED, 'success'); } } OSCOM::redirect('ext/modules/content/account/braintree/cards.php', '', 'SSL'); } $breadcrumb->add(MODULE_CONTENT_ACCOUNT_BRAINTREE_CARDS_NAVBAR_TITLE_1, OSCOM::link('account.php', '', 'SSL')); $breadcrumb->add(MODULE_CONTENT_ACCOUNT_BRAINTREE_CARDS_NAVBAR_TITLE_2, OSCOM::link('ext/modules/content/account/braintree/cards.php', '', 'SSL')); require 'includes/template_top.php'; ?> <h1><?php echo MODULE_CONTENT_ACCOUNT_BRAINTREE_CARDS_HEADING_TITLE; ?> </h1> <?php if ($messageStack->size('cards') > 0) { echo $messageStack->output('cards'); }
$Qcheck = $OSCOM_Db->prepare('select address_book_id from :table_address_book where address_book_id = :address_book_id and customers_id = :customers_id'); $Qcheck->bindInt(':address_book_id', $_GET['delete']); $Qcheck->bindInt(':customers_id', $_SESSION['customer_id']); $Qcheck->execute(); if ($Qcheck->fetch() === false) { $messageStack->add_session('addressbook', ERROR_NONEXISTING_ADDRESS_BOOK_ENTRY); OSCOM::redirect('address_book.php', '', 'SSL'); } } } else { $entry = array(); } if (!isset($_GET['delete']) && !isset($_GET['edit'])) { if (tep_count_customer_address_book_entries() >= MAX_ADDRESS_BOOK_ENTRIES) { $messageStack->add_session('addressbook', ERROR_ADDRESS_BOOK_FULL); OSCOM::redirect('address_book.php', '', 'SSL'); } } $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('account.php', '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2, OSCOM::link('address_book.php', '', 'SSL')); if (isset($_GET['edit']) && is_numeric($_GET['edit'])) { $breadcrumb->add(NAVBAR_TITLE_MODIFY_ENTRY, OSCOM::link('address_book_process.php', 'edit=' . $_GET['edit'], 'SSL')); } elseif (isset($_GET['delete']) && is_numeric($_GET['delete'])) { $breadcrumb->add(NAVBAR_TITLE_DELETE_ENTRY, OSCOM::link('address_book_process.php', 'delete=' . $_GET['delete'], 'SSL')); } else { $breadcrumb->add(NAVBAR_TITLE_ADD_ENTRY, OSCOM::link('address_book_process.php', '', 'SSL')); } require 'includes/template_top.php'; ?> <div class="page-header">
function after_process() { global $insert_id, $sagepay_server_transaction_details; $OSCOM_Db = Registry::get('Db'); $sql_data_array = array('orders_id' => $insert_id, 'orders_status_id' => DEFAULT_ORDERS_STATUS_ID, 'date_added' => 'now()', 'customer_notified' => '0', 'comments' => trim($sagepay_server_transaction_details)); $OSCOM_Db->save('orders_status_history', $sql_data_array); if (MODULE_PAYMENT_SAGE_PAY_SERVER_PROFILE_PAGE == 'Low') { $_SESSION['cart']->reset(true); // unregister session variables used during checkout unset($_SESSION['sendto']); unset($_SESSION['billto']); unset($_SESSION['shipping']); unset($_SESSION['payment']); unset($_SESSION['comments']); unset($_SESSION['sage_pay_server_nexturl']); OSCOM::redirect('ext/modules/payment/sage_pay/redirect.php', '', 'SSL'); } }
$review = HTML::sanitize($_POST['review']); $error = false; if (strlen($review) < REVIEW_TEXT_MIN_LENGTH) { $error = true; $messageStack->add('review', JS_REVIEW_TEXT); } if ($rating < 1 || $rating > 5) { $error = true; $messageStack->add('review', JS_REVIEW_RATING); } if ($error == false) { $OSCOM_Db->save('reviews', ['products_id' => $Qcheck->valueInt('products_id'), 'customers_id' => $_SESSION['customer_id'], 'customers_name' => $Qcustomer->value('customers_firstname') . ' ' . $Qcustomer->value('customers_lastname'), 'reviews_rating' => $rating, 'date_added' => 'now()']); $insert_id = $OSCOM_Db->lastInsertId(); $OSCOM_Db->save('reviews_description', ['reviews_id' => $insert_id, 'languages_id' => $_SESSION['languages_id'], 'reviews_text' => $review]); $messageStack->add_session('product_reviews', TEXT_REVIEW_RECEIVED, 'success'); OSCOM::redirect('product_reviews.php', tep_get_all_get_params(array('action'))); } } if ($new_price = tep_get_products_special_price($Qcheck->valueInt('products_id'))) { $products_price = '<del>' . $currencies->display_price($Qcheck->valueDecimal('products_price'), tep_get_tax_rate($Qcheck->valueInt('products_tax_class_id'))) . '</del> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($Qcheck->valueInt('products_tax_class_id'))) . '</span>'; } else { $products_price = $currencies->display_price($Qcheck->valueDecimal('products_price'), tep_get_tax_rate($Qcheck->valueInt('products_tax_class_id'))); } $products_name = $Qcheck->value('products_name'); if (!empty($Qcheck->value('products_model'))) { $products_name .= ' <small>[' . $Qcheck->value('products_model') . ']</small>'; } $breadcrumb->add(NAVBAR_TITLE, OSCOM::link('product_reviews.php', tep_get_all_get_params())); require 'includes/template_top.php'; ?>
OSCOM::redirect(FILENAME_LANGUAGES, 'page=' . $_GET['page'] . '&lID=' . $_GET['lID']); break; case 'deleteconfirm': $lID = HTML::sanitize($_GET['lID']); $Qlanguage = $OSCOM_Db->get('languages', 'languages_id', ['code' => DEFAULT_LANGUAGE]); if ($Qlanguage->valueInt('languages_id') === (int) $lID) { $OSCOM_Db->save('configuration', ['configuration_value' => ''], ['configuration_key' => 'DEFAULT_CURRENCY']); } $OSCOM_Db->delete('categories_description', ['language_id' => $lID]); $OSCOM_Db->delete('products_description', ['language_id' => $lID]); $OSCOM_Db->delete('products_options', ['language_id' => $lID]); $OSCOM_Db->delete('products_options_values', ['language_id' => $lID]); $OSCOM_Db->delete('manufacturers_info', ['languages_id' => $lID]); $OSCOM_Db->delete('orders_status', ['language_id' => $lID]); $OSCOM_Db->delete('languages', ['languages_id' => $lID]); OSCOM::redirect(FILENAME_LANGUAGES, 'page=' . $_GET['page']); break; case 'delete': $lID = HTML::sanitize($_GET['lID']); $Qlanguage = $OSCOM_Db->get('languages', 'code', ['languages_id' => $lID]); $remove_language = true; if ($Qlanguage->value('code') == DEFAULT_LANGUAGE) { $remove_language = false; $OSCOM_MessageStack->add(OSCOM::getDef('error_remove_default_language'), 'error'); } break; } } $icons = []; foreach (glob(OSCOM::getConfig('dir_root', 'Shop') . 'public/third_party/flag-icon-css/flags/4x3/*.svg') as $file) { $code = basename($file, '.svg');
if (isset($_POST['delete_image']) && $_POST['delete_image'] == 'on') { $Qbanner = $OSCOM_Db->get('banners', 'banners_image', ['banners_id' => (int) $banners_id]); if (tep_not_null($Qbanner->value('banners_image')) && is_file(OSCOM::getConfig('dir_root', 'Shop') . 'images/' . $Qbanner->value('banners_image'))) { if (FileSystem::isWritable(OSCOM::getConfig('dir_root', 'Shop') . 'images/' . $Qbanner->value('banners_image'))) { unlink(OSCOM::getConfig('dir_root', 'Shop') . 'images/' . $Qbanner->value('banners_image')); } else { $OSCOM_MessageStack->add(OSCOM::getDef('error_image_is_not_writeable'), 'error'); } } else { $OSCOM_MessageStack->add(OSCOM::getDef('error_image_does_not_exist'), 'error'); } } $OSCOM_Db->delete('banners', ['banners_id' => (int) $banners_id]); $OSCOM_Db->delete('banners_history', ['banners_id' => (int) $banners_id]); $OSCOM_MessageStack->add(OSCOM::getDef('success_banner_removed'), 'success'); OSCOM::redirect(FILENAME_BANNER_MANAGER, 'page=' . $_GET['page']); break; case 'preview': $banners_id = HTML::sanitize($_GET['banner']); $Qbanner = $OSCOM_Db->get('banners', ['banners_title', 'banners_image', 'banners_html_text'], ['banners_id' => (int) $banners_id]); if ($Qbanner->check()) { echo '<h1>' . $Qbanner->valueProtected('banners_title') . '</h1>'; if (tep_not_null($Qbanner->value('banners_html_text'))) { echo $Qbanner->value('banners_html_text'); } elseif (tep_not_null($Qbanner->value('banners_image'))) { echo HTML::image(OSCOM::linkImage('Shop/' . $Qbanner->value('banners_image')), $Qbanner->value('banners_title')); } exit; } break; }
if (!isset($_SESSION['customer_id'])) { $_SESSION['navigation']->set_snapshot(); OSCOM::redirect('login.php'); } $OSCOM_Language->loadDefinitions('account_newsletters'); $Qnewsletter = $OSCOM_Db->prepare('select customers_newsletter from :table_customers where customers_id = :customers_id'); $Qnewsletter->bindInt(':customers_id', $_SESSION['customer_id']); $Qnewsletter->execute(); if (isset($_POST['action']) && $_POST['action'] == 'process' && isset($_POST['formid']) && $_POST['formid'] == $_SESSION['sessiontoken']) { $newsletter_general = isset($_POST['newsletter_general']) && $_POST['newsletter_general'] == '1' ? 1 : 0; if ($newsletter_general !== $Qnewsletter->valueInt('customers_newsletter')) { $newsletter_general = $Qnewsletter->valueInt('customers_newsletter') === 1 ? 0 : 1; $OSCOM_Db->save('customers', ['customers_newsletter' => $newsletter_general], ['customers_id' => $_SESSION['customer_id']]); } $messageStack->add_session('account', OSCOM::getDef('success_newsletter_updated'), 'success'); OSCOM::redirect('account.php'); } $breadcrumb->add(OSCOM::getDef('navbar_title_1'), OSCOM::link('account.php')); $breadcrumb->add(OSCOM::getDef('navbar_title_2'), OSCOM::link('account_newsletters.php')); require $oscTemplate->getFile('template_top.php'); ?> <div class="page-header"> <h1><?php echo OSCOM::getDef('heading_title'); ?> </h1> </div> <?php echo HTML::form('account_newsletter', OSCOM::link('account_newsletters.php'), 'post', 'class="form-horizontal"', ['tokenize' => true, 'action' => 'process']);
require DIR_WS_CLASSES . 'shipping.php'; $shipping_modules = new shipping($_SESSION['shipping']); require DIR_WS_CLASSES . 'order_total.php'; $order_total_modules = new order_total(); $order_total_modules->process(); // Stock Check $any_out_of_stock = false; if (STOCK_CHECK == 'true') { for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) { if (tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) { $any_out_of_stock = true; } } // Out of Stock if (STOCK_ALLOW_CHECKOUT != 'true' && $any_out_of_stock == true) { OSCOM::redirect('shopping_cart.php'); } } require DIR_WS_LANGUAGES . $_SESSION['language'] . '/checkout_confirmation.php'; $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('checkout_shipping.php', '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2); require 'includes/template_top.php'; ?> <div class="page-header"> <h1><?php echo HEADING_TITLE; ?> </h1> </div>
* @copyright (c) 2016 osCommerce; https://www.oscommerce.com * @license MIT; https://www.oscommerce.com/license/mit.txt */ use OSC\OM\OSCOM; chdir('../../../../'); require 'includes/application_top.php'; // if the customer is not logged on, redirect them to the login page if (!isset($_SESSION['customer_id'])) { $_SESSION['navigation']->set_snapshot(array('page' => 'checkout_payment.php')); OSCOM::redirect('login.php'); } if (!isset($_SESSION['sage_pay_direct_acsurl'])) { OSCOM::redirect('checkout_payment.php'); } if (!isset($_SESSION['payment']) || $_SESSION['payment'] != 'sage_pay_direct') { OSCOM::redirect('checkout_payment.php'); } $OSCOM_Language->loadDefinitions('checkout_confirmation'); $OSCOM_Language->loadDefinitions('modules/payment/sage_pay_direct'); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html <?php echo OSCOM::getDef('html_params'); ?> > <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo OSCOM::getDef('charset'); ?> "> <title><?php
if ($error == false) { $sql_data_array = array('customers_firstname' => $firstname, 'customers_lastname' => $lastname, 'customers_email_address' => $email_address, 'customers_telephone' => $telephone, 'customers_fax' => $fax); if (ACCOUNT_GENDER == 'true') { $sql_data_array['customers_gender'] = $gender; } if (ACCOUNT_DOB == 'true') { $sql_data_array['customers_dob'] = tep_date_raw($dob); } $OSCOM_Db->save('customers', $sql_data_array, ['customers_id' => (int) $_SESSION['customer_id']]); $OSCOM_Db->save('customers_info', ['customers_info_date_account_last_modified' => 'now()'], ['customers_info_id' => (int) $_SESSION['customer_id']]); $sql_data_array = ['entry_firstname' => $firstname, 'entry_lastname' => $lastname]; $OSCOM_Db->save('address_book', $sql_data_array, ['customers_id' => (int) $_SESSION['customer_id'], 'address_book_id' => (int) $_SESSION['customer_default_address_id']]); // reset the session variables $_SESSION['customer_first_name'] = $firstname; $messageStack->add_session('account', SUCCESS_ACCOUNT_UPDATED, 'success'); OSCOM::redirect('account.php', '', 'SSL'); } } $Qaccount = $OSCOM_Db->prepare('select * from :table_customers where customers_id = :customers_id'); $Qaccount->bindInt(':customers_id', $_SESSION['customer_id']); $Qaccount->execute(); $breadcrumb->add(NAVBAR_TITLE_1, OSCOM::link('account.php', '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2, OSCOM::link('account_edit.php', '', 'SSL')); require 'includes/template_top.php'; ?> <div class="page-header"> <h1><?php echo HEADING_TITLE; ?> </h1>
if (!in_array($class . $file_extension, $modules_installed)) { $modules_installed[] = $class . $file_extension; } Registry::get('Db')->save('configuration', ['configuration_value' => implode(';', $modules_installed)], ['configuration_key' => $module_key]); OSCOM::redirect(FILENAME_MODULES, 'set=' . $set . '&module=' . $class); } elseif ($action == 'remove') { $module->remove(); $modules_installed = explode(';', constant($module_key)); if (in_array($class . $file_extension, $modules_installed)) { unset($modules_installed[array_search($class . $file_extension, $modules_installed)]); } Registry::get('Db')->save('configuration', ['configuration_value' => implode(';', $modules_installed)], ['configuration_key' => $module_key]); OSCOM::redirect(FILENAME_MODULES, 'set=' . $set); } } OSCOM::redirect(FILENAME_MODULES, 'set=' . $set . '&module=' . $class); break; } } require $oscTemplate->getFile('template_top.php'); $modules_installed = defined($module_key) ? explode(';', constant($module_key)) : array(); $new_modules_counter = 0; $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.')); $directory_array = array(); if ($dir = @dir($module_directory)) { while ($file = $dir->read()) { if (!is_dir($module_directory . $file)) { if (substr($file, strrpos($file, '.')) == $file_extension) { if (isset($_GET['list']) && $_GET['list'] == 'new') { if (!in_array($file, $modules_installed)) { $directory_array[] = $file;
OSCOM::redirect(FILENAME_TAX_RATES); break; case 'save': $tax_rates_id = HTML::sanitize($_GET['tID']); $tax_zone_id = HTML::sanitize($_POST['tax_zone_id']); $tax_class_id = HTML::sanitize($_POST['tax_class_id']); $tax_rate = HTML::sanitize($_POST['tax_rate']); $tax_description = HTML::sanitize($_POST['tax_description']); $tax_priority = HTML::sanitize($_POST['tax_priority']); $OSCOM_Db->save('tax_rates', ['tax_zone_id' => (int) $tax_zone_id, 'tax_class_id' => (int) $tax_class_id, 'tax_rate' => $tax_rate, 'tax_description' => $tax_description, 'tax_priority' => (int) $tax_priority, 'last_modified' => 'now()'], ['tax_rates_id' => (int) $tax_rates_id]); OSCOM::redirect(FILENAME_TAX_RATES, 'page=' . $_GET['page'] . '&tID=' . $tax_rates_id); break; case 'deleteconfirm': $tax_rates_id = HTML::sanitize($_GET['tID']); $OSCOM_Db->delete('tax_rates', ['tax_rates_id' => (int) $tax_rates_id]); OSCOM::redirect(FILENAME_TAX_RATES, 'page=' . $_GET['page']); break; } } require $oscTemplate->getFile('template_top.php'); ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo OSCOM::getDef('heading_title'); ?> </td> </tr>
$class = Apps::getModuleClass($code, 'Content'); $installed_code = $m['code']; } else { $installed_code = $m['group'] . '/' . $m['code']; } $module = new $class(); $module->remove(); $modules_installed = explode(';', MODULE_CONTENT_INSTALLED); if (in_array($installed_code, $modules_installed)) { unset($modules_installed[array_search($installed_code, $modules_installed)]); } Registry::get('Db')->save('configuration', ['configuration_value' => implode(';', $modules_installed), 'last_modified' => 'now()'], ['configuration_key' => 'MODULE_CONTENT_INSTALLED']); OSCOM::redirect('modules_content.php'); } } OSCOM::redirect('modules_content.php', 'module=' . $code); break; } } require $oscTemplate->getFile('template_top.php'); ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo OSCOM::getDef('heading_title'); ?> </td> <?php
<?php /** * osCommerce Online Merchant * * @copyright (c) 2016 osCommerce; https://www.oscommerce.com * @license MIT; https://www.oscommerce.com/license/mit.txt */ use OSC\OM\HTML; use OSC\OM\OSCOM; chdir('../../../../'); require 'includes/application_top.php'; // if the customer is not logged on, redirect them to the login page if (!isset($_SESSION['customer_id'])) { $_SESSION['navigation']->set_snapshot(array('page' => 'checkout_payment.php')); OSCOM::redirect('login.php'); } if (isset($_GET['payment_error']) && tep_not_null($_GET['payment_error'])) { $redirect_url = OSCOM::link('checkout_payment.php', 'payment_error=' . $_GET['payment_error'] . (isset($_GET['error']) && tep_not_null($_GET['error']) ? '&error=' . $_GET['error'] : '')); } else { $hidden_params = ''; if ($_SESSION['payment'] == 'sage_pay_direct') { $redirect_url = OSCOM::link('checkout_process.php', 'check=3D'); $hidden_params = HTML::hiddenField('MD', $_POST['MD']) . HTML::hiddenField('PaRes', $_POST['PaRes']); } else { $redirect_url = OSCOM::link('checkout_success.php'); } } $OSCOM_Language->loadDefinitions('checkout_confirmation'); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
} OSCOM::redirect($PHP_SELF, tep_get_all_get_params(array('action'))); } else { $_SESSION['navigation']->set_snapshot(); OSCOM::redirect('login.php', '', 'SSL'); } break; case 'cust_order': if (isset($_SESSION['customer_id']) && isset($_GET['pid'])) { if (tep_has_product_attributes($_GET['pid'])) { OSCOM::redirect('product_info.php', 'products_id=' . $_GET['pid']); } else { $_SESSION['cart']->add_cart($_GET['pid'], $_SESSION['cart']->get_quantity($_GET['pid']) + 1); } } OSCOM::redirect($goto, tep_get_all_get_params($parameters)); break; } } // include the who's online functions require 'includes/functions/whos_online.php'; tep_update_whos_online(); // include the password crypto functions require 'includes/functions/password_funcs.php'; // include validation functions (right now only email address) require 'includes/functions/validations.php'; // auto activate and expire banners require 'includes/functions/banner.php'; tep_activate_banners(); tep_expire_banners(); // auto expire special products
OSCOM::redirect(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $_GET['rID']); break; case 'update': $reviews_id = HTML::sanitize($_GET['rID']); $reviews_rating = HTML::sanitize($_POST['reviews_rating']); $reviews_text = HTML::sanitize($_POST['reviews_text']); $reviews_status = HTML::sanitize($_POST['reviews_status']); $OSCOM_Db->save('reviews', ['reviews_rating' => $reviews_rating, 'reviews_status' => $reviews_status, 'last_modified' => 'now()'], ['reviews_id' => (int) $reviews_id]); $OSCOM_Db->save('reviews_description', ['reviews_text' => $reviews_text], ['reviews_id' => (int) $reviews_id]); OSCOM::redirect(FILENAME_REVIEWS, 'page=' . $_GET['page'] . '&rID=' . $reviews_id); break; case 'deleteconfirm': $reviews_id = HTML::sanitize($_GET['rID']); $OSCOM_Db->delete('reviews', ['reviews_id' => (int) $reviews_id]); $OSCOM_Db->delete('reviews_description', ['reviews_id' => (int) $reviews_id]); OSCOM::redirect(FILENAME_REVIEWS, 'page=' . $_GET['page']); break; } } require $oscTemplate->getFile('template_top.php'); ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo OSCOM::getDef('heading_title'); ?> </td> </tr>