本文整理汇总了PHP中MyOOS_CoreApi::redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP MyOOS_CoreApi::redirect方法的具体用法?PHP MyOOS_CoreApi::redirect怎么用?PHP MyOOS_CoreApi::redirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyOOS_CoreApi
的用法示例。
在下文中一共展示了MyOOS_CoreApi::redirect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create_plugin_instance
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;
}
示例2: create_plugin_instance
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;
}
示例3: create_plugin_instance
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;
}
示例4: create_plugin_instance
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;
}
示例5: oos_href_link
}
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'));
}
示例6: Copyright
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');
示例7: COUNT
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']);
示例8: oos_db_input
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']));
示例9: oos_get_all_get_parameters
}
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;
}
示例10: oos_get_all_get_parameters
// 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']),
示例11: oos_db_perform
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'));
}
示例12: array
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'];
示例13: oos_get_all_get_parameters
}
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';
}
示例14: create_plugin_instance
//.........这里部分代码省略.........
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;
}
示例15: create_plugin_instance
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;
}