function create_plugin_instance() { $aPages = oos_get_pages(); if (isset($_GET['page']) && $_GET['page'] != $aPages['info_down_for_maintenance']) { MyOOS_CoreApi::redirect(oos_href_link($aPages['info_down_for_maintenance'], '', 'NONSSL', true, false)); } return true; }
function create_plugin_instance() { $aFilename = oos_get_filename(); $aModules = oos_get_modules(); if ($_GET['file'] != $aFilename['info_down_for_maintenance']) { MyOOS_CoreApi::redirect(oos_href_link($aModules['info'], $aFilename['info_down_for_maintenance'], '', 'NONSSL', true, false)); } return true; }
function create_plugin_instance() { if (!isset($_SESSION['customer_id']) || !is_numeric($_SESSION['customer_id'])) { $aPages = oos_get_pages(); if (isset($_GET['page']) && $_GET['page'] != $aPages['login']) { $_SESSION['navigation']->set_snapshot(); MyOOS_CoreApi::redirect(oos_href_link($aPages['login'], '', 'SSL')); } } return true; }
function create_plugin_instance() { if (!isset($_SESSION['customer_id'])) { $aFilename = oos_get_filename(); $aModules = oos_get_modules(); if ($_GET['mp'] != $aModules['user']) { $_SESSION['navigation']->set_snapshot(); MyOOS_CoreApi::redirect(oos_href_link($aModules['user'], $aFilename['login'], '', 'SSL')); } } return true; }
} if (is_array($oPaymentModules->modules)) { $oPaymentModules_process_button = $oPaymentModules->process_button(); } $oSmarty->assign('payment_modules_process_button', $oPaymentModules_process_button); if (isset($$_SESSION['payment']->form_action_url)) { $form_action_url = $$_SESSION['payment']->form_action_url; } else { $form_action_url = oos_href_link($aPages['checkout_process'], '', 'SSL'); } $oSmarty->assign('form_action_url', $form_action_url); $oSmarty->assign('order', $oOrder); $oSmarty->assign('oosBreadcrumb', $oSmarty->fetch($aOption['breadcrumb'])); $oSmarty->assign('oosPageHeading', $oSmarty->fetch($aOption['page_heading'])); $oSmarty->assign('contents', $oSmarty->fetch($aOption['template_main'])); // display the template require 'includes/oos_display.php'; } else { MyOOS_CoreApi::redirect(oos_href_link($aPages['checkout_shipping'], '', 'SSL')); }
File: order_history.php,v 1.4 2003/02/10 22:31:02 hpdl ---------------------------------------------------------------------- osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce ---------------------------------------------------------------------- Released under the GNU General Public License ---------------------------------------------------------------------- */ // DO NOT RUN THIS SCRIPT STANDALONE defined( 'OOS_VALID_MOD' ) or die( 'Direct Access to this location is not allowed.' ); if ( !isset( $_SESSION['customer_id'] ) || !is_numeric( $_SESSION['customer_id'] )) { $_SESSION['navigation']->set_snapshot(); MyOOS_CoreApi::redirect(oos_href_link($aPages['login'], '', 'SSL')); } // split-page-results if (isset($_GET['nv'])) { $nCurrentPageNumber = filter_input(INPUT_GET, 'nv', FILTER_VALIDATE_INT); } elseif (isset($_POST['nv'])) { $nCurrentPageNumber = filter_input(INPUT_POST, 'nv', FILTER_VALIDATE_INT); } else { $nCurrentPageNumber = 1; } if (empty($nCurrentPageNumber) || !is_numeric($nCurrentPageNumber)) $nCurrentPageNumber = 1; MyOOS_CoreApi::requireOnce('classes/class_split_page_results.php');
if (isset($_SESSION['cart']->cartID) && isset($_SESSION['cartID'])) { if ($_SESSION['cart']->cartID != $_SESSION['cartID']) { MyOOS_CoreApi::redirect(oos_href_link($aPages['checkout_shipping'], '', 'SSL')); } } // Stock Check if (STOCK_CHECK == '1' && STOCK_ALLOW_CHECKOUT != '1') { $products = $_SESSION['cart']->get_products(); $any_out_of_stock = 0; for ($i = 0, $n = count($products); $i < $n; $i++) { if (oos_check_stock($products[$i]['id'], $products[$i]['quantity'])) { $any_out_of_stock = 1; } } if ($any_out_of_stock == 1) { MyOOS_CoreApi::redirect(oos_href_link($aPages['shopping_cart'])); } } // if no billing destination address was selected, use the customers own address as default if (!isset($_SESSION['billto'])) { $_SESSION['billto'] = $_SESSION['customer_default_address_id']; } else { // verify the selected billing address $address_booktable = $oostable['address_book']; $sql = "SELECT COUNT(*) AS total\n FROM {$address_booktable}\n WHERE customers_id = '" . intval($_SESSION['customer_id']) . "'\n AND address_book_id = '" . intval($_SESSION['billto']) . "'"; $check_address_result = $dbconn->Execute($sql); $check_address = $check_address_result->fields; if ($check_address['total'] != '1') { $_SESSION['billto'] = $_SESSION['customer_default_address_id']; if (isset($_SESSION['payment'])) { unset($_SESSION['payment']);
if ($check_customer_result->RecordCount()) { $check_customer = $check_customer_result->fields; $customerstable = $oostable['customers']; $dbconn->Execute("UPDATE {$customerstable}\n SET customers_newsletter = '0'\n WHERE customers_id = '" . $check_customer['customers_id'] . "'"); MyOOS_CoreApi::redirect(oos_href_link($aPages['newsletters_unsubscribe_success'])); } else { $maillisttable = $oostable['maillist']; $sql = "SELECT customers_firstname\n FROM {$maillisttable}\n WHERE customers_email_address = '" . oos_db_input($email_address) . "'"; $check_mail_customer_result = $dbconn->Execute($sql); if ($check_mail_customer_result->RecordCount()) { $maillisttable = $oostable['maillist']; $dbconn->Execute("UPDATE {$maillisttable}\n SET customers_newsletter = '0'\n WHERE customers_email_address = '" . oos_db_input($email_address) . "'"); MyOOS_CoreApi::redirect(oos_href_link($aPages['newsletters_unsubscribe_success'])); } } MyOOS_CoreApi::redirect(oos_href_link($aPages['subscription_center'], 'email=nonexistent', 'SSL')); } else { $oBreadcrumb->add($aLang['navbar_title'], oos_href_link($aPages['newsletters']), bookmark); $aOption['template_main'] = $sTheme . '/modules/subscription_center.html'; $aOption['page_heading'] = $sTheme . '/heading/page_heading.html'; $aOption['breadcrumb'] = 'default/system/breadcrumb.html'; $nPageType = OOS_PAGE_TYPE_SERVICE; require 'includes/oos_system.php'; if (!isset($option)) { require 'includes/info_message.php'; require 'includes/oos_blocks.php'; } // assign Smarty variables; $oSmarty->assign(array('oos_breadcrumb' => $oBreadcrumb->trail(BREADCRUMB_SEPARATOR), 'oos_heading_title' => $aLang['heading_title'], 'oos_heading_image' => 'password_forgotten.gif')); $oSmarty->assign('oosBreadcrumb', $oSmarty->fetch($aOption['breadcrumb'])); $oSmarty->assign('oosPageHeading', $oSmarty->fetch($aOption['page_heading']));
} if ($_SESSION['error_cart_msg'] == '') { MyOOS_CoreApi::redirect(oos_href_link($goto_file, oos_get_all_get_parameters($parameters), 'NONSSL')); } else { MyOOS_CoreApi::redirect(oos_href_link($aPages['product_info'], 'products_id=' . $_POST['products_id'])); } } break; case 'frend_wishlist_add_product': if (isset($_POST['products_id']) && is_numeric($_POST['cart_quantity'])) { $cart_qty = $_SESSION['cart']->get_quantity(oos_get_uprid($_POST['products_id'], $_POST['id'])); $news_qty = $cart_qty + $cart_quantity; $products_order_min = oos_get_products_quantity_order_min($_POST['products_id']); $products_order_units = oos_get_products_quantity_order_units($_POST['products_id']); if ($cart_quantity >= $products_order_min or $cart_qty >= $products_order_min) { if ($cart_quantity % $products_order_units == 0 and $news_qty >= $products_order_min) { $_SESSION['cart']->add_cart($_POST['products_id'], intval($news_qty), $_POST['id'], true, $_POST['to_wl_id']); } else { $_SESSION['error_cart_msg'] = $aLang['error_products_quantity_order_min_text'] . $aLang['error_products_units_invalid'] . $cart_quantity . ' - ' . $aLang['products_order_qty_unit_text_info'] . ' ' . $products_order_units; } } else { $_SESSION['error_cart_msg'] = $aLang['error_products_quantity_order_min_text'] . $aLang['error_products_quantity_invalid'] . $cart_quantity . ' - ' . $aLang['products_order_qty_min_text_info'] . ' ' . $products_order_min; } if ($_SESSION['error_cart_msg'] == '') { MyOOS_CoreApi::redirect(oos_href_link($goto_file, oos_get_all_get_parameters($parameters), 'NONSSL')); } else { MyOOS_CoreApi::redirect(oos_href_link($aPages['product_info'], 'products_id=' . $_POST['products_id'])); } } break; }
// lets retrieve all $_GET keys and values.. $get_params = oos_get_all_get_parameters(array('reviews_id')); $get_params = oos_remove_trailing($get_params); $productstable = $oostable['products']; $products_descriptiontable = $oostable['products_description']; $sql = "SELECT pd.products_name, p.products_model FROM $products_descriptiontable pd LEFT JOIN $productstable p ON pd.products_id = p.products_id WHERE pd.products_languages_id = '" . intval($nLanguageID) . "' AND p.products_status >= '1' AND pd.products_id = '" . intval($nProductsId) . "'"; $product_info_result = $dbconn->Execute($sql); if (!$product_info_result->RecordCount()) MyOOS_CoreApi::redirect(oos_href_link($aPages['reviews'])); $product_info = $product_info_result->fields; $reviewstable = $oostable['reviews']; $sql = "SELECT reviews_rating, reviews_id, customers_name, date_added, reviews_read FROM $reviewstable WHERE products_id = '" . intval($nProductsId) . "' ORDER BY reviews_id DESC"; $reviews_result = $dbconn->Execute($sql); $aReviews = array(); while ($reviews = $reviews_result->fields) { $aReviews[] = array('rating' => $reviews['reviews_rating'], 'id' => $reviews['reviews_id'], 'customers_name' => $reviews['customers_name'], 'date_added' => oos_date_short($reviews['date_added']),
if (ACCOUNT_STATE == '1') { if ($zone_id > 0) { $sql_data_array['entry_zone_id'] = $zone_id; $sql_data_array['entry_state'] = ''; } else { $sql_data_array['entry_zone_id'] = '0'; $sql_data_array['entry_state'] = $state; } } oos_db_perform($oostable['address_book'], $sql_data_array); $customers_infotable = $oostable['customers_info']; $dbconn->Execute("INSERT INTO " . $customers_infotable . "\n (customers_info_id,\n customers_info_number_of_logons,\n customers_info_date_account_created) VALUES ('" . intval($customer_id) . "',\n '0',\n '" . date("Y-m-d H:i:s", time()) . "')"); $_SESSION['customer_id'] = $customer_id; $_SESSION['customer_wishlist_link_id'] = $wishlist_link_id; $_SESSION['customer_first_name'] = $firstname; $_SESSION['customer_default_address_id'] = 1; $_SESSION['customer_country_id'] = $country; $_SESSION['customer_zone_id'] = $zone_id; $_SESSION['customer_max_order'] = $customer_max_order; $_SESSION['man_key'] = $keya; if (ACCOUNT_VAT_ID == '1') { if (ACCOUNT_COMPANY_VAT_ID_CHECK == '1' && $vatid_check_error === false) { $_SESSION['customers_vat_id_status'] = 1; } else { $_SESSION['customers_vat_id_status'] = 0; } } // restore cart contents $_SESSION['cart']->restore_contents(); MyOOS_CoreApi::redirect(oos_href_link($aModules['user'], $aFilename['create_account_success'], '', 'SSL')); }
if (isset($_GET['action']) && $_GET['action'] == 'update') { $notify = $_POST['notify']; if (!is_array($notify)) { $notify = array($notify); } for ($i = 0, $n = count($notify); $i < $n; $i++) { $products_notificationstable = $oostable['products_notifications']; $sql = "SELECT COUNT(*) AS total\n FROM {$products_notificationstable}\n WHERE products_id = '" . intval($notify[$i]) . "'\n AND customers_id = '" . intval($_SESSION['customer_id']) . "'"; $check = $dbconn->Execute($sql); if ($check->fields['total'] < 1) { $products_notificationstable = $oostable['products_notifications']; $sql = "INSERT INTO {$products_notificationstable}\n (products_id,\n customers_id,\n date_added) VALUES (" . $dbconn->qstr($notify[$i]) . ',' . $dbconn->qstr($_SESSION['customer_id']) . ',' . $dbconn->DBTimeStamp($today) . ")"; $result = $dbconn->Execute($sql); } } MyOOS_CoreApi::redirect(oos_href_link($aModules['main'], $aFilename['main'])); } // links breadcrumb $oBreadcrumb->add($aLang['navbar_title_1']); $oBreadcrumb->add($aLang['navbar_title_2']); $customers_infotable = $oostable['customers_info']; $sql = "SELECT global_product_notifications\n FROM {$customers_infotable}\n WHERE customers_info_id = '" . intval($_SESSION['customer_id']) . "'"; $global_result = $dbconn->Execute($sql); $global = $global_result->fields; if ($global['global_product_notifications'] != '1') { $orderstable = $oostable['orders']; $sql = "SELECT orders_id\n FROM {$orderstable}\n WHERE customers_id = '" . intval($_SESSION['customer_id']) . "'\n ORDER BY date_purchased desc LIMIT 1"; $orders_result = $dbconn->Execute($sql); $orders = $orders_result->fields; $products_array = array(); $orders_productstable = $oostable['orders_products'];
} if (!isset($_GET['reviews_id'])) { MyOOS_CoreApi::redirect(oos_href_link($aPages['reviews'])); } require 'includes/languages/' . $sLanguage . '/reviews_product_info.php'; // lets retrieve all $_GET keys and values.. $get_parameters = oos_get_all_get_parameters(array('reviews_id')); $get_parameters = oos_remove_trailing($get_parameters); $reviewstable = $oostable['reviews']; $productstable = $oostable['products']; $reviews_descriptiontable = $oostable['reviews_description']; $products_descriptiontable = $oostable['products_description']; $sql = "SELECT rd.reviews_text, r.reviews_rating, r.reviews_id, r.products_id,\n r.customers_name, r.date_added, r.last_modified, r.reviews_read,\n p.products_id, pd.products_name, p.products_model, p.products_image\n FROM {$reviewstable} r,\n {$reviews_descriptiontable} rd,\n {$productstable} p,\n {$products_descriptiontable} pd\n WHERE r.reviews_id = '" . intval($_GET['reviews_id']) . "'\n AND r.reviews_id = rd.reviews_id\n AND rd.reviews_languages_id = '" . intval($nLanguageID) . "'\n AND r.products_id = p.products_id\n AND p.products_status >= '1'\n AND p.products_id = pd.products_id\n AND pd.products_languages_id = '" . intval($nLanguageID) . "'"; $reviews_result = $dbconn->Execute($sql); if (!$reviews_result->RecordCount()) { MyOOS_CoreApi::redirect(oos_href_link($aPages['reviews'])); } $reviews = $reviews_result->fields; $dbconn->Execute("UPDATE " . $oostable['reviews'] . "\n SET reviews_read = reviews_read+1\n WHERE reviews_id = '" . $reviews['reviews_id'] . "'"); // links breadcrumb $oBreadcrumb->add($reviews['products_name'], oos_href_link($aPages['product_info'], 'categories=' . $categories . '&products_id=' . $reviews['products_id'])); $oBreadcrumb->add($aLang['navbar_title'], oos_href_link($aPages['product_reviews'], $get_parameters), bookmark); $aOption['template_main'] = $sTheme . '/modules/product_reviews_info.html'; $aOption['page_heading'] = $sTheme . '/heading/page_heading.html'; $aOption['breadcrumb'] = 'default/system/breadcrumb.html'; $nPageType = OOS_PAGE_TYPE_REVIEWS; require 'includes/oos_system.php'; if (!isset($option)) { require 'includes/info_message.php'; require 'includes/oos_blocks.php'; }
function create_plugin_instance() { global $request_type, $spider_flag, $spider_kill_sid; $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); $spider_flag = false; $spider_kill_sid = '0'; // set the top level domains $http_domain = oos_server_get_top_level_domain(OOS_HTTP_SERVER); $https_domain = oos_server_get_top_level_domain(OOS_HTTPS_SERVER); $current_domain = (($request_type == 'NONSSL') ? $http_domain : $https_domain); // set the session cookie parameters if (function_exists('session_set_cookie_params')) { session_set_cookie_params(0, '/', (!empty($current_domain) ? '.' . $current_domain : '')); } elseif (function_exists('ini_set')) { ini_set('session.cookie_lifetime', '0'); ini_set('session.cookie_path', '/'); ini_set('session.cookie_domain', (!empty($current_domain) ? '.' . $current_domain : '')); } // set the session ID if it exists if (isset($_POST[oos_session_name()]) && (ctype_alnum($_POST[oos_session_name()]))) { oos_session_id($_POST[oos_session_name()]); } elseif (isset($_GET[oos_session_name()]) && (ctype_alnum($_GET[oos_session_name()]))) { oos_session_id($_GET[oos_session_name()]); } if (empty($user_agent) === false) { $spider_agent = @parse_ini_file('includes/ini/spiders.ini'); foreach ($spider_agent as $spider) { if (empty($spider) === false) { if (strpos($user_agent, trim($spider)) !== false) { $spider_kill_sid = '1'; $spider_flag = true; break; } } } } if ($spider_flag === false) { if (!defined('MYOOS_SESSION_NAME')) { define('MYOOS_SESSION_NAME', 'MYOOS_SESSID'); } @ini_set('session.name', MYOOS_SESSION_NAME); if(ini_get('session.save_handler') == 'user') { @ini_set('session.save_handler', 'files'); @ini_set('session.save_path', ''); } if(ini_get('session.save_handler') == 'files') { $sessionPath = ini_get('session.save_path'); if (preg_match('/^[0-9]+;(.*)/', $sessionPath, $matches)) { $sessionPath = $matches[1]; } if (ini_get('safe_mode') || ini_get('open_basedir') || empty($sessionPath) || !@is_writable($sessionPath)) { $sessionPath = MYOOS_USER_PATH . '/tmp/sessions'; @ini_set('session.save_path', $sessionPath); if (!is_dir($sessionPath)) { @mkdir($sessionPath, 0755, true); if (!is_dir($sessionPath)) { die("Error: Unable to mkdir $sessionPath"); } } elseif (!@is_writable($sessionPath)) { die("Error: $sessionPath is not writable"); } } } // lets start our session oos_session_start(); } if (!isset($_SESSION)) { $_SESSION = array(); } // create the shopping cart if (!isset($_SESSION['cart'])) { $_SESSION['cart'] = new shoppingCart; } // navigation history if (!isset($_SESSION['navigation'])) { $_SESSION['navigation'] = new oosNavigationHistory; } $aPages = oos_get_pages(); // verify the browser user agent $http_user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; if (!isset($_SESSION['session_user_agent'])) { $_SESSION['session_user_agent'] = $http_user_agent; } if ($_SESSION['session_user_agent'] != $http_user_agent) { unset($_SESSION['customer_id']); unset($_SESSION['session_user_agent']); $_SESSION['cart']->reset(); $_SESSION['member']->default_member(); MyOOS_CoreApi::redirect(oos_href_link($aPages['login'], '', 'SSL')); } // verify the IP address if (!isset($_SESSION['session_ip_address'])) { $_SESSION['session_ip_address'] = MyOOS_Utilities::getRemoteHostAddress(); } if ($_SESSION['session_ip_address'] != MyOOS_Utilities::getRemoteHostAddress()) { unset($_SESSION['customer_id']); unset($_SESSION['session_ip_address']); $_SESSION['cart']->reset(); $_SESSION['member']->default_member(); MyOOS_CoreApi::redirect(oos_href_link($aPages['login'], '', 'SSL')); } return true; }
function create_plugin_instance() { global $request_type, $spider_flag, $spider_kill_sid; $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); $spider_flag = false; $spider_kill_sid = '0'; // set the top level domains $http_domain = oos_server_get_top_level_domain(OOS_HTTP_SERVER); $https_domain = oos_server_get_top_level_domain(OOS_HTTPS_SERVER); $current_domain = (($request_type == 'NONSSL') ? $http_domain : $https_domain); // set the session cookie parameters if (function_exists('session_set_cookie_params')) { session_set_cookie_params(0, '/', (!empty($current_domain) ? '.' . $current_domain : '')); } elseif (function_exists('ini_set')) { ini_set('session.cookie_lifetime', '0'); ini_set('session.cookie_path', '/'); ini_set('session.cookie_domain', (!empty($current_domain) ? '.' . $current_domain : '')); } // set the session ID if it exists if (isset($_POST[oos_session_name()]) && (ctype_alnum($_POST[oos_session_name()]))) { oos_session_id($_POST[oos_session_name()]); } elseif (isset($_GET[oos_session_name()]) && (ctype_alnum($_GET[oos_session_name()]))) { oos_session_id($_GET[oos_session_name()]); } if (empty($user_agent) === false) { $spider_agent = @parse_ini_file('includes/ini/spiders.ini'); foreach ($spider_agent as $spider) { if (empty($spider) === false) { if (strpos($user_agent, trim($spider)) !== false) { $spider_kill_sid = '1'; $spider_flag = true; break; } } } } if ($spider_flag === false) { // lets start our session oos_session_start(); } if (!isset($_SESSION)) { $_SESSION = array(); } // create the shopping cart if (!isset($_SESSION['cart'])) { $_SESSION['cart'] = new shoppingCart; } // navigation history if (!isset($_SESSION['navigation'])) { $_SESSION['navigation'] = new oosNavigationHistory; } if (!isset($_SESSION['error_cart_msg'])) { $_SESSION['error_cart_msg'] = ''; } $aPages = oos_get_pages(); // verify the browser user agent $http_user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; if (!isset($_SESSION['session_user_agent'])) { $_SESSION['session_user_agent'] = $http_user_agent; } if ($_SESSION['session_user_agent'] != $http_user_agent) { unset($_SESSION['customer_id']); unset($_SESSION['session_user_agent']); $_SESSION['cart']->reset(); $_SESSION['member']->default_member(); MyOOS_CoreApi::redirect(oos_href_link($aPages['login'], '', 'SSL')); } // verify the IP address if (!isset($_SESSION['session_ip_address'])) { $_SESSION['session_ip_address'] = MyOOS_Utilities::getRemoteHostAddress(); } if ($_SESSION['session_ip_address'] != MyOOS_Utilities::getRemoteHostAddress()) { unset($_SESSION['customer_id']); unset($_SESSION['session_ip_address']); $_SESSION['cart']->reset(); $_SESSION['member']->default_member(); MyOOS_CoreApi::redirect(oos_href_link($aPages['login'], '', 'SSL')); } return true; }
http://www.oscommerce.com Copyright (c) 2001 - 2003 osCommerce ---------------------------------------------------------------------- Released under the GNU General Public License ---------------------------------------------------------------------- */ error_reporting(E_ALL); if (function_exists('ini_set')) { ini_set('display_errors', 1); ini_set('magic_quotes_runtime', 0); ini_set('session.save_handler', 'files'); } define('OOS_VALID_MOD', 'yes'); // MyOOS requires PHP 5.2+ version_compare(PHP_VERSION, '5.2', '<') and exit('MyOOS requires PHP 5.2 or newer.'); require dirname(__FILE__) . '/includes/oos_main.php'; $sMp = oos_var_prep_for_os($sMp); $sFile = oos_var_prep_for_os($sFile); $sLanguage = oos_var_prep_for_os($_SESSION['language']); $sTheme = oos_var_prep_for_os($_SESSION['theme']); if (is_readable('includes/pages/' . $sMp . '/' . $sFile . '.php')) { if (isset($_GET['history_back'])) { $_SESSION['navigation']->remove_last_page(); } else { $_SESSION['navigation']->add_current_page(); } require dirname(__FILE__) . '/includes/pages/' . $sMp . '/' . $sFile . '.php'; } else { MyOOS_CoreApi::redirect(oos_href_link($aModules['error'], $aFilename['error404'])); } require dirname(__FILE__) . '/includes/oos_nice_exit.php';
Based on: File: specials.php,v 1.46 2003/02/13 04:23:23 hpdl ---------------------------------------------------------------------- osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce ---------------------------------------------------------------------- Released under the GNU General Public License ---------------------------------------------------------------------- */ /** ensure this file is being included by a parent file */ defined('OOS_VALID_MOD') or die('Direct Access to this location is not allowed.'); if (!$oEvent->installed_plugin('spezials')) { $_SESSION['navigation']->remove_current_page(); MyOOS_CoreApi::redirect(oos_href_link($aModules['main'], $aFilename['main'], 'history_back=true')); } // split-page-results MyOOS_CoreApi::requireOnce('classes/class_split_page_results.php'); require 'includes/languages/' . $sLanguage . '/products_specials.php'; $aOption['template_main'] = $sTheme . '/products/specials.html'; $aOption['page_heading'] = $sTheme . '/heading/page_heading.html'; $aOption['page_navigation'] = $sTheme . '/heading/page_navigation.html'; $nPageType = OOS_PAGE_TYPE_CATALOG; $sGroup = trim($_SESSION['member']->group['text']); $nPage = isset($_GET[page]) ? $_GET[page] + 0 : 1; $contents_cache_id = $sTheme . '|info|' . $sGroup . '|spezials|' . $nPage . '|' . $sLanguage; require 'includes/oos_system.php'; if (!isset($option)) { require 'includes/info_message.php'; require 'includes/oos_blocks.php';
http://www.oscommerce.com Copyright (c) 2003 osCommerce ---------------------------------------------------------------------- Released under the GNU General Public License ---------------------------------------------------------------------- */ /** ensure this file is being included by a parent file */ defined('OOS_VALID_MOD') or die('Direct Access to this location is not allowed.'); if (isset($_SESSION['customer_id'])) { $customerstable = $oostable['customers']; $sql = "SELECT customers_firstname, customers_lastname, customers_email_address\n FROM {$customerstable}\n WHERE customers_id = '" . intval($_SESSION['customer_id']) . "'"; $account = $dbconn->Execute($sql); $account_values = $account->fields; } elseif (ALLOW_GUEST_TO_TELL_A_FRIEND == '0') { $_SESSION['navigation']->set_snapshot(); MyOOS_CoreApi::redirect(oos_href_link($aModules['user'], $aFilename['login'], '', 'SSL')); } require 'includes/languages/' . $sLanguage . '/tell_a_friend_tell_a_friend.php'; $action = ''; if (isset($_GET['action']) && $_GET['action'] == 'process') { $action = 'process'; } $valid_product = false; if (isset($_GET['products_id'])) { if (!isset($nProductsId)) { $nProductsId = oos_get_product_id($_GET['products_id']); } $productstable = $oostable['products']; $products_descriptiontable = $oostable['products_description']; $sql = "SELECT pd.products_name\n FROM {$productstable} p,\n {$products_descriptiontable} pd\n WHERE p.products_status >= '1'\n AND p.products_id = '" . intval($nProductsId) . "'\n AND p.products_id = pd.products_id\n AND pd.products_languages_id = '" . intval($nLanguageID) . "'"; $product_info_result = $dbconn->Execute($sql);
} if (!isset($_GET['reviews_id'])) { MyOOS_CoreApi::redirect(oos_href_link($aModules['reviews'], $aFilename['reviews_reviews'])); } require 'includes/languages/' . $sLanguage . '/reviews_product_info.php'; // lets retrieve all $_GET keys and values.. $get_parameters = oos_get_all_get_parameters(array('reviews_id')); $get_parameters = oos_remove_trailing($get_parameters); $reviewstable = $oostable['reviews']; $productstable = $oostable['products']; $reviews_descriptiontable = $oostable['reviews_description']; $products_descriptiontable = $oostable['products_description']; $sql = "SELECT rd.reviews_text, r.reviews_rating, r.reviews_id, r.products_id,\n r.customers_name, r.date_added, r.last_modified, r.reviews_read,\n p.products_id, pd.products_name, p.products_model, p.products_image\n FROM {$reviewstable} r,\n {$reviews_descriptiontable} rd,\n {$productstable} p,\n {$products_descriptiontable} pd\n WHERE r.reviews_id = '" . intval($_GET['reviews_id']) . "'\n AND r.reviews_id = rd.reviews_id\n AND rd.reviews_languages_id = '" . intval($nLanguageID) . "'\n AND r.products_id = p.products_id\n AND p.products_status >= '1'\n AND p.products_id = pd.products_id\n AND pd.products_languages_id = '" . intval($nLanguageID) . "'"; $reviews_result = $dbconn->Execute($sql); if (!$reviews_result->RecordCount()) { MyOOS_CoreApi::redirect(oos_href_link($aModules['reviews'], $aFilename['reviews_reviews'])); } $reviews = $reviews_result->fields; $dbconn->Execute("UPDATE " . $oostable['reviews'] . "\n SET reviews_read = reviews_read+1\n WHERE reviews_id = '" . $reviews['reviews_id'] . "'"); // links breadcrumb $oBreadcrumb->add($reviews['products_name'], oos_href_link($aModules['products'], $aFilename['product_info'], 'categories=' . $categories . '&products_id=' . $reviews['products_id'])); $oBreadcrumb->add($aLang['navbar_title'], oos_href_link($aModules['reviews'], $aFilename['product_reviews'], $get_parameters)); $aOption['template_main'] = $sTheme . '/modules/product_reviews_info.html'; $aOption['page_heading'] = $sTheme . '/heading/page_heading.html'; $nPageType = OOS_PAGE_TYPE_REVIEWS; require 'includes/oos_system.php'; if (!isset($option)) { require 'includes/info_message.php'; require 'includes/oos_blocks.php'; } $oSmarty->assign(array('oos_breadcrumb' => $oBreadcrumb->trail(BREADCRUMB_SEPARATOR), 'oos_heading_title' => sprintf($aLang['heading_title'], $reviews['products_name']), 'oos_heading_image' => 'reviews.gif', 'popup_window' => 'popup_window.js', 'reviews' => $reviews));
function pre_confirmation_check() { global $aLang; include 'includes/classes/class_cc_validation.php'; $cc_validation = new cc_validation(); $result = $cc_validation->validate($_POST['cc_number'], $_POST['cc_expires_month'], $_POST['cc_expires_year'], $_POST['cc_start_month'], $_POST['cc_start_year'], $_POST['cc_cvv'], $_POST['cc_issue']); $error = ''; switch ($result) { case -1 : $error = sprintf($aLang['text_ccval_error_unknown_card'], substr($cc_validation->cc_number, 0, 4)); break ; case -2 : case -3 : case -4 : $error = $aLang['text_ccval_error_invalid_date']; break; case -5 : $cards = ''; if (MODULE_PAYMENT_CC_ACCEPT_VISA == '1') $cards .= ' Visa,'; if (MODULE_PAYMENT_CC_ACCEPT_MASTERCARD == '1') $cards .= ' Master Card,'; if (MODULE_PAYMENT_CC_ACCEPT_AMERICANEXPRESS == '1') $cards .= ' American Express,'; if (MODULE_PAYMENT_CC_ACCEPT_DINERSCLUB == '1') $cards .= ' Diners Club,'; if (MODULE_PAYMENT_CC_ACCEPT_DISCOVERNOVUS == '1') $cards .= ' Discover,'; if (MODULE_PAYMENT_CC_ACCEPT_JCB == '1') $cards .= ' JCB,'; if (MODULE_PAYMENT_CC_ACCEPT_OZBANKCARD == '1') $cards .= ' Australian BankCard,'; $error = sprintf($aLang['text_card_not_aczepted'], $cc_validation->cc_type).$cards; break; case false: $error = $aLang['text_ccval_error_invalid_number']; break; } if ( ($result == false) || ($result < 1) ) { $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&cc_owner=' . urlencode($_POST['cc_owner']) . '&cc_expires_month=' . $_POST['cc_expires_month'] . '&cc_expires_year=' . $_POST['cc_expires_year']; $aPages = oos_get_pages(); MyOOS_CoreApi::redirect(oos_href_link($aPages['checkout_payment'], $payment_error_return, 'SSL', true, false)); } if (USE_CC_CVV != '1') { $this->cc_cvv = '000'; } $this->cc_card_type = $cc_validation->cc_type; $this->cc_card_number = $cc_validation->cc_number; }
Copyright (c) 2003 - 2009 by the OOS Development Team. ---------------------------------------------------------------------- Released under the GNU General Public License ---------------------------------------------------------------------- */ // DO NOT RUN THIS SCRIPT STANDALONE if (count(get_included_files()) < 2) { header("HTTP/1.1 301 Moved Permanently"); header("Location: /"); exit; } if (isset($_GET['products_id'])) { if (!isset($nProductsId)) $nProductsId = oos_get_product_id($_GET['products_id']); } if ( empty( $nProductsId ) || !is_numeric( $nProductsId ) ) { MyOOS_CoreApi::redirect(oos_href_link($aPages['main'])); } require 'includes/languages/' . $sLanguage . '/products_cross_sell.php'; $productstable = $oostable['products']; $products_descriptiontable = $oostable['products_description']; $product_info_sql = "SELECT p.products_id, pd.products_name, p.products_model FROM $productstable p, $products_descriptiontable pd WHERE p.products_status >= '1' AND (p.products_access = '0' OR p.products_access = '" . intval($nGroupID) . "') AND p.products_id = '" . intval($nProductsId) . "' AND pd.products_id = p.products_id AND pd.products_languages_id = '" . intval($nLanguageID) . "'";
} if ($_SESSION['error_cart_msg'] == '') { MyOOS_CoreApi::redirect(oos_href_link($goto_mp, $goto_file, oos_get_all_get_parameters($parameters), 'NONSSL')); } else { MyOOS_CoreApi::redirect(oos_href_link($aModules['products'], $aFilename['product_info'], 'products_id=' . $_POST['products_id'])); } } break; case 'frend_wishlist_add_product': if (isset($_POST['products_id']) && is_numeric($_POST['cart_quantity'])) { $cart_qty = $_SESSION['cart']->get_quantity(oos_get_uprid($_POST['products_id'], $_POST['id'])); $news_qty = $cart_qty + $cart_quantity; $products_order_min = oos_get_products_quantity_order_min($_POST['products_id']); $products_order_units = oos_get_products_quantity_order_units($_POST['products_id']); if ($cart_quantity >= $products_order_min or $cart_qty >= $products_order_min) { if ($cart_quantity % $products_order_units == 0 and $news_qty >= $products_order_min) { $_SESSION['cart']->add_cart($_POST['products_id'], intval($news_qty), $_POST['id'], true, $_POST['to_wl_id']); } else { $_SESSION['error_cart_msg'] = $aLang['error_products_quantity_order_min_text'] . $aLang['error_products_units_invalid'] . $cart_quantity . ' - ' . $aLang['products_order_qty_unit_text_info'] . ' ' . $products_order_units; } } else { $_SESSION['error_cart_msg'] = $aLang['error_products_quantity_order_min_text'] . $aLang['error_products_quantity_invalid'] . $cart_quantity . ' - ' . $aLang['products_order_qty_min_text_info'] . ' ' . $products_order_min; } if ($_SESSION['error_cart_msg'] == '') { MyOOS_CoreApi::redirect(oos_href_link($goto_mp, $goto_file, oos_get_all_get_parameters($parameters), 'NONSSL')); } else { MyOOS_CoreApi::redirect(oos_href_link($aModules['products'], $aFilename['product_info'], 'products_id=' . $_POST['products_id'])); } } break; }
die("Error: Unable to mkdir $sessionPath"); } } elseif(!@is_writable($sessionPath)) { die("Error: $sessionPath is not writable"); } } } require_once MYOOS_INCLUDE_PATH . '/includes/oos_main.php'; $sPage = oos_var_prep_for_os($sPage); if (is_readable('includes/pages/' . $sPage . '.php')) { if (isset($_GET['history_back'])){ $_SESSION['navigation']->remove_last_page(); } else { $_SESSION['navigation']->add_current_page(); } require_once MYOOS_INCLUDE_PATH . '/includes/pages/' . $sPage . '.php'; } else { MyOOS_CoreApi::redirect(oos_href_link($aPages['error404'])); } require_once MYOOS_INCLUDE_PATH . '/includes/oos_nice_exit.php';
if ($gender == 'm') { $email_owner .= $aLang['entry_gender'] . ' ' . $aLang['male'] . "\n"; } else { $email_owner .= $aLang['entry_gender'] . ' ' . $aLang['female'] . "\n"; } } $email_owner .= $aLang['owner_email_first_name'] . ' ' . $firstname . "\n" . $aLang['owner_email_last_name'] . ' ' . $lastname . "\n\n" . $aLang['owner_email_street'] . ' ' . $street_address . "\n" . $aLang['owner_email_post_code'] . ' ' . $postcode . "\n" . $aLang['owner_email_city'] . ' ' . $city . "\n" . $aLang['email_separator'] . "\n\n" . $aLang['owner_email_contact'] . "\n" . $aLang['owner_email_telephone_number'] . ' ' . $telephone . "\n" . $aLang['owner_email_fax_number'] . ' ' . $fax . "\n" . $aLang['owner_email_address'] . ' ' . $email_address . "\n" . $aLang['email_separator'] . "\n\n" . $aLang['owner_email_options'] . "\n"; if ($newsletter == '1') { $email_owner .= $aLang['owner_email_newsletter'] . $aLang['entry_newsletter_yes'] . "\n"; } else { $email_owner .= $aLang['owner_email_newsletter'] . $aLang['entry_newsletter_no'] . "\n"; } oos_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $aLang['owner_email_subject'], nl2br($email_owner), $name, $email_address); } MyOOS_CoreApi::redirect(oos_href_link($aPages['account'], '', 'SSL')); }
} // assign Smarty variables; $oSmarty->assign(array('oos_breadcrumb' => $oBreadcrumb->trail(BREADCRUMB_SEPARATOR), 'oos_heading_title' => $aLang['heading_title'], 'oos_heading_image' => 'confirmation.gif')); if (MODULE_ORDER_TOTAL_INSTALLED) { $oOrderTotalModules->process(); $order_total_output = $oOrderTotalModules->output(); $oSmarty->assign('order_total_output', $order_total_output); } if (is_array($oPaymentModules->modules)) { if ($confirmation = $oPaymentModules->confirmation()) { $oSmarty->assign('confirmation', $confirmation); } } if (isset(${$_SESSION}['payment']->form_action_url)) { $form_action_url = ${$_SESSION}['payment']->form_action_url; } else { $form_action_url = oos_href_link($aModules['checkout'], $aFilename['checkout_process'], '', 'SSL'); } $oSmarty->assign('form_action_url', $form_action_url); if (is_array($oPaymentModules->modules)) { $oPaymentModules_process_button = $oPaymentModules->process_button(); } $oSmarty->assign('payment_modules_process_button', $oPaymentModules_process_button); $oSmarty->assign('order', $oOrder); $oSmarty->assign('oosPageHeading', $oSmarty->fetch($aOption['page_heading'])); $oSmarty->assign('contents', $oSmarty->fetch($aOption['template_main'])); // display the template require 'includes/oos_display.php'; } else { MyOOS_CoreApi::redirect(oos_href_link($aModules['checkout'], $aFilename['checkout_shipping'], '', 'SSL')); }
if (isset($_GET['wlid'])) { $wlid = oos_db_prepare_input($_GET['wlid']); } if (strlen($wlid) < 10) { unset($wlid); } $wishlist_result_raw = "SELECT products_id, customers_wishlist_date_added\n FROM " . $oostable['customers_wishlist'] . "\n WHERE customers_wishlist_link_id = '" . oos_db_input($wlid) . "'\n ORDER BY customers_wishlist_date_added"; $wishlist_split = new splitPageResults($_GET['page'], MAX_DISPLAY_WISHLIST_PRODUCTS, $wishlist_result_raw, $wishlist_numrows); $wishlist_result = $dbconn->Execute($wishlist_result_raw); if (!$wishlist_result->RecordCount()) { MyOOS_CoreApi::redirect(oos_href_link($aPages['main'], '', 'NONSSL')); } $sql = "SELECT customers_firstname, customers_lastname\n FROM " . $oostable['customers'] . "\n WHERE customers_wishlist_link_id = '" . oos_db_input($wlid) . "'"; $customer_result = $dbconn->Execute($sql); if (!$customer_result->RecordCount()) { MyOOS_CoreApi::redirect(oos_href_link($aPages['main'], '', 'NONSSL')); } $customer_info = $customer_result->fields; $customer = $customer_info['customers_firstname'] . ' ' . $customer_info['customers_lastname'] . ': '; $aWishlist = array(); while ($wishlist = $wishlist_result->fields) { $wl_products_id = oos_get_product_id($wishlist['products_id']); $sql = "SELECT p.products_id, pd.products_name, pd.products_description, p.products_model,\n p.products_image, p.products_price, p.products_base_price, p.products_base_unit,\n p.products_discount_allowed, p.products_tax_class_id, p.products_units_id\n FROM " . $oostable['products'] . " p,\n " . $oostable['products_description'] . " pd\n WHERE p.products_id = '" . intval($wl_products_id) . "'\n AND pd.products_id = p.products_id\n AND pd.products_languages_id = '" . intval($nLanguageID) . "'"; $wishlist_product = $dbconn->GetRow($sql); $wishlist_product_price = ''; $wishlist_product_special_price = ''; $wishlist_product_discount = 0; $wishlist_product_discount_price = ''; $wishlist_base_product_price = ''; $wishlist_base_product_special_price = ''; $wishlist_special_price = '';
function pre_confirmation_check() { global $aLang; if (MODULE_PAYMENT_PSIGATE_INPUT_MODE == 'Local') { include 'includes/classes/class_cc_validation.php'; $cc_validation = new cc_validation(); $result = $cc_validation->validate($_POST['psigate_cc_number'], $_POST['psigate_cc_expires_month'], $_POST['psigate_cc_expires_year']); $error = ''; switch ($result) { case -1: $error = sprintf($aLang['text_ccval_error_unknown_card'], substr($cc_validation->cc_number, 0, 4)); break; case -2: case -3: case -4: $error = $aLang['text_ccval_error_invalid_date']; break; case false: $error = $aLang['text_ccval_error_invalid_number']; break; } if ($result == false || $result < 1) { $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&psigate_cc_owner=' . urlencode($_POST['psigate_cc_owner']) . '&psigate_cc_expires_month=' . $_POST['psigate_cc_expires_month'] . '&psigate_cc_expires_year=' . $_POST['psigate_cc_expires_year']; $aFilename = oos_get_filename(); $aModules = oos_get_modules(); MyOOS_CoreApi::redirect(oos_href_link($aModules['checkout'], $aFilename['checkout_payment'], $payment_error_return, 'SSL', true, false)); } $this->cc_card_type = $cc_validation->cc_type; $this->cc_card_number = $cc_validation->cc_number; $this->cc_expiry_month = $cc_validation->cc_expiry_month; $this->cc_expiry_year = $cc_validation->cc_expiry_year; } else { return false; } }
Copyright (c) 2003 osCommerce ---------------------------------------------------------------------- Released under the GNU General Public License ---------------------------------------------------------------------- */ /** ensure this file is being included by a parent file */ defined('OOS_VALID_MOD') or die('Direct Access to this location is not allowed.'); require 'includes/languages/' . $sLanguage . '/main_contact_us.php'; $error = '0'; if (isset($_POST['action']) && $_POST['action'] == 'send' && (isset($_SESSION['formid']) && $_SESSION['formid'] == $_POST['formid'])) { $name = oos_prepare_input($_POST['name']); $email = oos_prepare_input($_POST['email']); $enquiry = oos_prepare_input($_POST['enquiry']); if (oos_validate_is_email(trim($email))) { oos_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $aLang['email_subject'], $enquiry, $name, $email); MyOOS_CoreApi::redirect(oos_href_link($aModules['main'], $aFilename['contact_us'], 'action=success')); } else { $error = '1'; } } // links breadcrumb $oBreadcrumb->add($aLang['navbar_title'], oos_href_link($aModules['main'], $aFilename['contact_us'])); $aOption['template_main'] = $sTheme . '/system/old_contact_us.html'; $aOption['page_heading'] = $sTheme . '/heading/page_heading.html'; $nPageType = OOS_PAGE_TYPE_MAINPAGE; require 'includes/oos_system.php'; if (!isset($option)) { require 'includes/info_message.php'; require 'includes/oos_blocks.php'; } // assign Smarty variables;
Based on: File: specials.php,v 1.46 2003/02/13 04:23:23 hpdl ---------------------------------------------------------------------- osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce ---------------------------------------------------------------------- Released under the GNU General Public License ---------------------------------------------------------------------- */ /** ensure this file is being included by a parent file */ defined('OOS_VALID_MOD') or die('Direct Access to this location is not allowed.'); if (!$oEvent->installed_plugin('spezials')) { $_SESSION['navigation']->remove_current_page(); MyOOS_CoreApi::redirect(oos_href_link($aPages['main'], 'history_back=true')); } // split-page-results MyOOS_CoreApi::requireOnce('classes/class_split_page_results.php'); require 'includes/languages/' . $sLanguage . '/products_specials.php'; $aOption['template_main'] = $sTheme . '/products/specials.html'; $aOption['page_heading'] = $sTheme . '/heading/page_heading.html'; $aOption['page_navigation'] = $sTheme . '/heading/page_navigation.html'; $aOption['breadcrumb'] = 'default/system/breadcrumb.html'; $nPageType = OOS_PAGE_TYPE_CATALOG; $sGroup = trim($_SESSION['member']->group['text']); $nPage = isset($_GET[page]) ? $_GET[page] + 0 : 1; $contents_cache_id = $sTheme . '|info|' . $sGroup . '|spezials|' . $nPage . '|' . $sLanguage; require 'includes/oos_system.php'; if (!isset($option)) { require 'includes/info_message.php';
} // Die if remaining count is <=0 if ($downloads['download_count'] <= 0) { die; } // Die if file is not there if (!file_exists(OOS_DOWNLOAD_PATH . $downloads['orders_products_filename'])) { die; } // Now decrement counter $dbconn->Execute("UPDATE " . $oostable['orders_products_download'] . "\n SET download_count = download_count-1\n WHERE orders_products_download_id = '" . intval($_GET['id']) . "'"); // Now send the file with header() magic header("Expires: Mon, 26 Nov 1962 00:00:00 GMT"); header("Last-Modified: " . gmdate("D,d M Y H:i:s") . " GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); header("Content-Type: Application/octet-stream"); header("Content-disposition: attachment; filename=" . $downloads['orders_products_filename']); if (DOWNLOAD_BY_REDIRECT == '1') { // This will work only on Unix/Linux hosts oos_unlink_temp_dir(OOS_DOWNLOAD_PATH_PUBLIC); $tempdir = oos_random_name(); umask(00); mkdir(OOS_DOWNLOAD_PATH_PUBLIC . $tempdir, 0777); symlink(OOS_DOWNLOAD_PATH . $downloads['orders_products_filename'], OOS_DOWNLOAD_PATH_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename']); MyOOS_CoreApi::redirect(OOS_DOWNLOAD . $tempdir . '/' . $downloads['orders_products_filename']); } else { // This will work on all systems, but will need considerable resources // We could also loop with fread($fp, 4096) to save memory readfile(OOS_DOWNLOAD_PATH . $downloads['orders_products_filename']); }