本文整理汇总了PHP中tep_redirect函数的典型用法代码示例。如果您正苦于以下问题:PHP tep_redirect函数的具体用法?PHP tep_redirect怎么用?PHP tep_redirect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tep_redirect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pre_confirmation_check
function pre_confirmation_check()
{
global $HTTP_POST_VARS;
include DIR_WS_CLASSES . 'cc_validation.php';
$cc_validation = new cc_validation();
$result = $cc_validation->validate($HTTP_POST_VARS['cc_number'], $HTTP_POST_VARS['cc_expires_month'], $HTTP_POST_VARS['cc_expires_year']);
$error = '';
switch ($result) {
case -1:
$error = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, substr($cc_validation->cc_number, 0, 4));
break;
case -2:
case -3:
case -4:
$error = TEXT_CCVAL_ERROR_INVALID_DATE;
break;
case false:
$error = TEXT_CCVAL_ERROR_INVALID_NUMBER;
break;
}
if ($result == false || $result < 1) {
$payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&cc_owner=' . urlencode($HTTP_POST_VARS['cc_owner']) . '&cc_expires_month=' . $HTTP_POST_VARS['cc_expires_month'] . '&cc_expires_year=' . $HTTP_POST_VARS['cc_expires_year'];
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
}
$this->cc_card_type = $cc_validation->cc_type;
$this->cc_card_number = $cc_validation->cc_number;
}
示例2: _process
function _process()
{
global $messageStack, $osC_Database, $osC_Customer;
if (!isset($_POST['password_current']) || strlen(trim($_POST['password_current'])) < ACCOUNT_PASSWORD) {
$messageStack->add('account_password', ENTRY_PASSWORD_CURRENT_ERROR);
} elseif (!isset($_POST['password_new']) || strlen(trim($_POST['password_new'])) < ACCOUNT_PASSWORD) {
$messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR);
} elseif (!isset($_POST['password_confirmation']) || trim($_POST['password_new']) != trim($_POST['password_confirmation'])) {
$messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING);
}
if ($messageStack->size('account_password') === 0) {
$Qcheck = $osC_Database->query('select customers_password from :table_customers where customers_id = :customers_id');
$Qcheck->bindTable(':table_customers', TABLE_CUSTOMERS);
$Qcheck->bindInt(':customers_id', $osC_Customer->id);
$Qcheck->execute();
if (tep_validate_password(trim($_POST['password_current']), $Qcheck->value('customers_password'))) {
$Qupdate = $osC_Database->query('update :table_customers set customers_password = :customers_password where customers_id = :customers_id');
$Qupdate->bindTable(':table_customers', TABLE_CUSTOMERS);
$Qupdate->bindValue(':customers_password', tep_encrypt_password(trim($_POST['password_new'])));
$Qupdate->bindInt(':customers_id', $osC_Customer->id);
$Qupdate->execute();
$Qupdate = $osC_Database->query('update :table_customers_info set customers_info_date_account_last_modified = now() where customers_info_id = :customers_info_id');
$Qupdate->bindTable(':table_customers_info', TABLE_CUSTOMERS_INFO);
$Qupdate->bindInt(':customers_info_id', $osC_Customer->id);
$Qupdate->execute();
$messageStack->add_session('account', SUCCESS_PASSWORD_UPDATED, 'success');
tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
} else {
$messageStack->add('account_password', ERROR_CURRENT_PASSWORD_NOT_MATCHING);
}
}
}
示例3: execute
function execute()
{
if (isset($_GET['tabaction'])) {
$ppstatus_query = tep_db_query("select comments from orders_status_history where orders_id = '" . (int) $_GET['oID'] . "' and orders_status_id = '" . (int) OSCOM_APP_PAYPAL_TRANSACTIONS_ORDER_STATUS_ID . "' and comments like '%Transaction ID:%' order by date_added limit 1");
if (tep_db_num_rows($ppstatus_query)) {
$ppstatus = tep_db_fetch_array($ppstatus_query);
$pp = array();
foreach (explode("\n", $ppstatus['comments']) as $s) {
if (!empty($s) && strpos($s, ':') !== false) {
$entry = explode(':', $s, 2);
$pp[trim($entry[0])] = trim($entry[1]);
}
}
if (isset($pp['Transaction ID'])) {
$o_query = tep_db_query("select o.orders_id, o.payment_method, o.currency, o.currency_value, ot.value as total from orders o, orders_total ot where o.orders_id = '" . (int) $_GET['oID'] . "' and o.orders_id = ot.orders_id and ot.class = 'ot_total'");
$o = tep_db_fetch_array($o_query);
switch ($_GET['tabaction']) {
case 'getTransactionDetails':
$this->getTransactionDetails($pp, $o);
break;
case 'doCapture':
$this->doCapture($pp, $o);
break;
case 'doVoid':
$this->doVoid($pp, $o);
break;
case 'refundTransaction':
$this->refundTransaction($pp, $o);
break;
}
tep_redirect(tep_href_link('orders.php', 'page=' . $_GET['page'] . '&oID=' . $_GET['oID'] . '&action=edit#section_status_history_content'));
}
}
}
}
示例4: tep_session_start
function tep_session_start()
{
$sane_session_id = true;
if (isset($_GET[tep_session_name()])) {
if (SESSION_FORCE_COOKIE_USE == 'True' || preg_match('/^[a-zA-Z0-9,-]+$/', $_GET[tep_session_name()]) == false) {
unset($_GET[tep_session_name()]);
$sane_session_id = false;
}
}
if (isset($_POST[tep_session_name()])) {
if (SESSION_FORCE_COOKIE_USE == 'True' || preg_match('/^[a-zA-Z0-9,-]+$/', $_POST[tep_session_name()]) == false) {
unset($_POST[tep_session_name()]);
$sane_session_id = false;
}
}
if (isset($_COOKIE[tep_session_name()])) {
if (preg_match('/^[a-zA-Z0-9,-]+$/', $_COOKIE[tep_session_name()]) == false) {
$session_data = session_get_cookie_params();
setcookie(tep_session_name(), '', time() - 42000, $session_data['path'], $session_data['domain']);
unset($_COOKIE[tep_session_name()]);
$sane_session_id = false;
}
}
if ($sane_session_id == false) {
tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'SSL', false));
}
register_shutdown_function('session_write_close');
return session_start();
}
示例5: start
function start()
{
$sane_session_id = true;
if (isset($_GET[$this->name])) {
if (preg_match('/^[a-zA-Z0-9]+$/', $_GET[$this->name]) == false) {
unset($_GET[$this->name]);
$sane_session_id = false;
}
} elseif (isset($_POST[$this->name])) {
if (preg_match('/^[a-zA-Z0-9]+$/', $_POST[$this->name]) == false) {
unset($_POST[$this->name]);
$sane_session_id = false;
}
} elseif (isset($_COOKIE[$this->name])) {
if (preg_match('/^[a-zA-Z0-9]+$/', $_COOKIE[$this->name]) == false) {
unset($_COOKIE[$this->name]);
$sane_session_id = false;
}
}
if ($sane_session_id == false) {
tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
} elseif (session_start()) {
$this->setStarted(true);
$this->setID();
return true;
}
return false;
}
示例6: tep_session_start
function tep_session_start() {
global $_GET, $_POST, $HTTP_COOKIE_VARS;
$sane_session_id = true;
if (isset($_GET[tep_session_name()])) {
if (preg_match('/^[a-zA-Z0-9]+$/', $_GET[tep_session_name()]) == false) {
unset($_GET[tep_session_name()]);
$sane_session_id = false;
}
} elseif (isset($_POST[tep_session_name()])) {
if (preg_match('/^[a-zA-Z0-9]+$/', $_POST[tep_session_name()]) == false) {
unset($_POST[tep_session_name()]);
$sane_session_id = false;
}
} elseif (isset($HTTP_COOKIE_VARS[tep_session_name()])) {
if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_COOKIE_VARS[tep_session_name()]) == false) {
$session_data = session_get_cookie_params();
setcookie(tep_session_name(), '', time()-42000, $session_data['path'], $session_data['domain']);
$sane_session_id = false;
}
}
if ($sane_session_id == false) {
tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
}
return session_start();
}
示例7: tep_session_start
function tep_session_start()
{
global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS;
$sane_session_id = true;
ini_set('session.save_path', _INCLUDES_DIR . '/session_store');
if (isset($HTTP_GET_VARS[tep_session_name()])) {
if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_GET_VARS[tep_session_name()]) == false) {
unset($HTTP_GET_VARS[tep_session_name()]);
$sane_session_id = false;
}
} elseif (isset($HTTP_POST_VARS[tep_session_name()])) {
if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_POST_VARS[tep_session_name()]) == false) {
unset($HTTP_POST_VARS[tep_session_name()]);
$sane_session_id = false;
}
} elseif (isset($HTTP_COOKIE_VARS[tep_session_name()])) {
if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_COOKIE_VARS[tep_session_name()]) == false) {
$session_data = session_get_cookie_params();
setcookie(tep_session_name(), '', time() - 42000, $session_data['path'], $session_data['domain']);
$sane_session_id = false;
}
}
if ($sane_session_id == false) {
tep_redirect(get_href_link(PAGE_DEFAULT, '', 'NONSSL', false));
}
return session_start();
}
示例8: start
function start($check_post = true)
{
extract(tep_load('defs', 'http_validator', 'database'));
if (isset($cDefs->external) && !empty($cDefs->external)) {
$check_post = false;
}
$this->id = $this->get_cookie($this->name);
if (empty($this->id) && SESSION_FORCE_COOKIE_USE != 'true' && isset($_GET[$this->name])) {
$this->id = $_GET[$this->name];
}
$result = false;
if (empty($this->id)) {
$result = $this->generate();
} else {
$result = $this->validate($this->id);
}
if ($check_post && count($_POST) && ($this->new_id || !$result)) {
tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE, '', 'NONSSL', false));
}
if ($result) {
$this->life = MAX_CATALOG_SESSION_TIME;
$this->started = true;
} else {
$this->reset();
}
}
示例9: install
function install()
{
if (!defined('MODULE_PAYMENT_MONEYBOOKERS_STATUS')) {
tep_redirect(tep_href_link('ext/modules/payment/moneybookers/activation.php', 'action=coreRequired'));
}
$zone_id = 0;
$zone_query = tep_db_query("select geo_zone_id from " . TABLE_GEO_ZONES . " where geo_zone_name = 'Moneybookers iDeal'");
if (tep_db_num_rows($zone_query)) {
$zone = tep_db_fetch_array($zone_query);
$zone_id = $zone['geo_zone_id'];
} else {
tep_db_query("insert into " . TABLE_GEO_ZONES . " values (null, 'Moneybookers iDeal', 'The zone for the Moneybookers iDeal payment module', null, now())");
$zone_id = tep_db_insert_id();
$country_query = tep_db_query("select countries_id from " . TABLE_COUNTRIES . " where countries_iso_code_2 = 'NL'");
if (tep_db_num_rows($country_query)) {
$country = tep_db_fetch_array($country_query);
tep_db_query("insert into " . TABLE_ZONES_TO_GEO_ZONES . " values (null, '" . (int) $country['countries_id'] . "', 0, '" . (int) $zone_id . "', null, now())");
}
}
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Moneybookers iDeal', 'MODULE_PAYMENT_MONEYBOOKERS_IDL_STATUS', 'False', 'Do you want to accept Moneybookers iDeal payments?', '6', '3', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_MONEYBOOKERS_IDL_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_MONEYBOOKERS_IDL_ZONE', '" . (int) $zone_id . "', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Preparing Order Status', 'MODULE_PAYMENT_MONEYBOOKERS_IDL_PREPARE_ORDER_STATUS_ID', '" . MODULE_PAYMENT_MONEYBOOKERS_PREPARE_ORDER_STATUS_ID . "', 'Set the status of prepared orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Transactions Order Status', 'MODULE_PAYMENT_MONEYBOOKERS_IDL_TRANSACTIONS_ORDER_STATUS_ID', '" . MODULE_PAYMENT_MONEYBOOKERS_TRANSACTIONS_ORDER_STATUS_ID . "', 'Set the status of callback transactions to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_MONEYBOOKERS_IDL_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
}
示例10: userLoginCheck
function userLoginCheck()
{
global $navigation, $login_account_number;
if (!tep_session_is_registered('login_account_number') || !tep_not_null($login_account_number)) {
$navigation->set_snapshot();
tep_redirect(get_href_link(PAGE_LOGIN, '', 'SSL'));
}
}
示例11: validate_array_selection
function validate_array_selection($entity, $action = 'list')
{
extract(tep_load('defs', 'message_stack'));
if (!isset($_POST[$entity]) || !is_array($_POST[$entity]) || !count($_POST[$entity])) {
$msg->add_session(WARNING_NOTHING_SELECTED, 'warning');
tep_redirect(tep_href_link($cDefs->script, tep_get_all_get_params('action') . 'action=' . $action));
}
}
示例12: osC_Checkout_Payment
function osC_Checkout_Payment()
{
global $osC_Database, $osC_Session, $osC_Customer, $osC_Services, $breadcrumb, $cart, $total_weight, $total_count, $payment_modules;
if ($cart->count_contents() < 1) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT, '', 'SSL'));
}
if ($osC_Services->isStarted('breadcrumb')) {
$breadcrumb->add(NAVBAR_TITLE_CHECKOUT_PAYMENT, tep_href_link(FILENAME_CHECKOUT, $this->_module, 'SSL'));
}
// if no shipping method has been selected, redirect the customer to the shipping method selection page
if ($osC_Session->exists('shipping') == false) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT, 'shipping', 'SSL'));
}
// avoid hack attempts during the checkout procedure by checking the internal cartID
if (isset($cart->cartID) && $osC_Session->exists('cartID')) {
if ($cart->cartID != $osC_Session->value('cartID')) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT, 'shipping', 'SSL'));
}
}
// Stock Check
if (STOCK_CHECK == 'true' && STOCK_ALLOW_CHECKOUT != 'true') {
$products = $cart->get_products();
for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
if (tep_check_stock($products[$i]['id'], $products[$i]['quantity'])) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT, 'SSL'));
break;
}
}
}
// redirect to the billing address page when no default address exists
if ($osC_Customer->hasDefaultAddress() === false) {
$this->page_contents = 'checkout_payment_address.php';
}
// if no billing destination address was selected, use the customers own address as default
if ($osC_Session->exists('billto') == false) {
$osC_Session->set('billto', $osC_Customer->default_address_id);
} else {
// verify the selected billing address
$Qcheck = $osC_Database->query('select count(*) as total from :table_address_book where customers_id = :customers_id and address_book_id = :address_book_id');
$Qcheck->bindTable(':table_address_book', TABLE_ADDRESS_BOOK);
$Qcheck->bindInt(':customers_id', $osC_Customer->id);
$Qcheck->bindInt(':address_book_id', $osC_Session->value('billto'));
$Qcheck->execute();
if ($Qcheck->valueInt('total') != 1) {
$osC_Session->set('billto', $osC_Customer->default_address_id);
$osC_Session->remove('payment');
}
}
$total_weight = $cart->show_weight();
$total_count = $cart->count_contents();
// load all enabled payment modules
require DIR_WS_CLASSES . 'payment.php';
$payment_modules = new payment();
if (isset($_GET['payment_error']) && is_object(${$_GET['payment_error']}) && ($error = ${$_GET['payment_error']}->get_error())) {
$messageStack->add('checkout_payment', $error['error'], 'error');
}
}
示例13: execute
function execute()
{
global $order_id;
if ((int) MODULE_CONTENT_CHECKOUT_SUCCESS_REDIRECT_OLD_ORDER_MINUTES > 0) {
$check_query = tep_db_query("select 1 from " . TABLE_ORDERS . " where orders_id = '" . (int) $order_id . "' and date_purchased < date_sub(now(), interval '" . (int) MODULE_CONTENT_CHECKOUT_SUCCESS_REDIRECT_OLD_ORDER_MINUTES . "' minute)");
if (tep_db_num_rows($check_query)) {
tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
}
}
}
示例14: process_options
function process_options()
{
global $g_script, $messageStack;
$cStrings =& $this->strings;
// Prepare the options array for storage
$options_array = array('text_pages' => isset($_POST['text_pages']) ? 1 : 0, 'text_collections' => isset($_POST['text_collections']) ? 1 : 0, 'image_collections' => isset($_POST['image_collections']) ? 1 : 0);
// Store user options
$this->save_options($options_array);
$messageStack->add_session(sprintf($cStrings->SUCCESS_PLUGIN_RECONFIGURED, $this->title), 'success');
tep_redirect(tep_href_link($g_script, tep_get_all_get_params(array('action')) . 'action=set_options'));
}
示例15: install
function install()
{
if (!defined('MODULE_PAYMENT_MONEYBOOKERS_STATUS')) {
tep_redirect(tep_href_link('ext/modules/payment/moneybookers/activation.php', 'action=coreRequired'));
}
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Moneybookers Bank Transfer', 'MODULE_PAYMENT_MONEYBOOKERS_BWI_STATUS', 'False', 'Do you want to accept Moneybookers Bank Transfer payments?', '6', '3', 'tep_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_MONEYBOOKERS_BWI_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_MONEYBOOKERS_BWI_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Preparing Order Status', 'MODULE_PAYMENT_MONEYBOOKERS_BWI_PREPARE_ORDER_STATUS_ID', '" . MODULE_PAYMENT_MONEYBOOKERS_PREPARE_ORDER_STATUS_ID . "', 'Set the status of prepared orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Transactions Order Status', 'MODULE_PAYMENT_MONEYBOOKERS_BWI_TRANSACTIONS_ORDER_STATUS_ID', '" . MODULE_PAYMENT_MONEYBOOKERS_TRANSACTIONS_ORDER_STATUS_ID . "', 'Set the status of callback transactions to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_MONEYBOOKERS_BWI_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");
}