本文整理汇总了PHP中httpredir函数的典型用法代码示例。如果您正苦于以下问题:PHP httpredir函数的具体用法?PHP httpredir怎么用?PHP httpredir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了httpredir函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
protected final function __construct()
{
if (isset($GLOBALS['session'])) {
//If the language is trying to be changed try to change it
if ((isset($_POST['set_language']) && ($switch = $_POST['set_language']) || isset($_GET['set_language']) && ($switch = $_GET['set_language'])) && $this->_valid($switch)) {
$GLOBALS['session']->set('language', $switch, 'client');
httpredir(currentPage(array('set_language')));
} else {
//See if the language is set in the session
if (!CC_IN_ADMIN && $GLOBALS['session']->has('language', 'client')) {
$this->_language = $GLOBALS['session']->get('language', 'client');
} elseif (CC_IN_ADMIN) {
$admin_lang = $GLOBALS['session']->get('user_language', 'admin');
$this->_language = !empty($admin_lang) ? $admin_lang : $GLOBALS['config']->get('config', 'default_language');
} else {
//Try the default config language
$cl = $GLOBALS['config']->get('config', 'default_language');
$this->_language = !empty($cl) && file_exists(CC_ROOT_DIR . '/language/' . $cl . '.xml') && $this->_valid($cl) ? $cl : 'en-GB';
if (file_exists(CC_ROOT_DIR . '/language/' . $this->_language . '.xml')) {
//Set the language to the session
$GLOBALS['session']->set('language', $this->_language, 'client');
} else {
trigger_error('No valid language found!', E_USER_ERROR);
}
}
}
} else {
$this->_language = 'en-GB';
}
$GLOBALS['smarty']->assign("CURRENT_LANGUAGE", $this->_language);
$this->loadLang();
}
示例2: process
public function process()
{
$order = Order::getInstance();
$cart_order_id = $_POST['orderRef'];
$order_summary = $order->getSummary($cart_order_id);
if (isset($_POST['signature'])) {
$check = $_POST;
unset($check['signature']);
ksort($check);
$build_query = http_build_query($check, '', '&');
$build_query = preg_replace('/%0D%0A|%0A%0D|%0A|%0D/i', '%0A', $build_query);
$sig_check = $_POST['signature'] == hash("SHA512", $build_query . $this->_module['merchant_passphrase']);
} else {
$sig_check = true;
}
if ($_POST['responseCode'] == '0' && $sig_check) {
$order->orderStatus(Order::ORDER_PROCESS, $cart_order_id);
$order->paymentStatus(Order::PAYMENT_SUCCESS, $cart_order_id);
}
$transData['notes'] = $sig_check == true ? 'response signature check verified' : 'response signature check failed';
$transData['gateway'] = 'CharityClear';
$transData['order_id'] = $_POST['orderRef'];
$transData['trans_id'] = $_POST['xref'];
$transData['amount'] = $_POST['amountReceived'] > 0 ? $_POST['amountReceived'] / 100 : '';
$transData['status'] = $_POST['responseMessage'];
$transData['customer_id'] = $order_summary['customer_id'];
$transData['extra'] = '';
$order->logTransaction($transData);
$url = explode('/modules/gateway/CharityClear', $GLOBALS['storeURL']);
httpredir($url[0] . '/index.php?_a=complete');
// ccNow doesn't send back any data at all right now so we have to leave it pending
//httpredir(currentPage(array('_g', 'type', 'cmd', 'module'), array('_a' => 'complete')));
return false;
}
示例3: __construct
protected final function __construct()
{
$cache = Cache::getInstance();
// Should we be showing prices?
if (Config::getInstance()->get('config', 'catalogue_hide_prices') && !User::getInstance()->is() && !CC_IN_ADMIN && !$GLOBALS['session']->has('admin_id', 'admin_data')) {
Session::getInstance()->set('hide_prices', true);
} else {
Session::getInstance()->delete('hide_prices');
}
// Switch Currency
if (isset($_POST['set_currency']) && !empty($_POST['set_currency']) && ($switch = $_POST['set_currency']) || isset($_GET['set_currency']) && !empty($_GET['set_currency']) && ($switch = $_GET['set_currency'])) {
if (preg_match('#^[A-Z]{3}$#i', $switch) && ($currency = $GLOBALS['db']->select('CubeCart_currency', array('updated'), array('code' => (string) $switch, 'active' => 1)))) {
$GLOBALS['session']->set('currency', $switch, 'client');
}
httpredir(currentPage(array('set_currency')));
}
// Autoload tax tables
$this->loadCurrencyVars();
}
示例4: __construct
public function __construct()
{
if ($GLOBALS['config']->get('config', 'ssl') && !ADMIN_CP && !CC_SSL && !in_array($_GET['_g'], $this->_ignored_pages)) {
$current_url = currentPage();
$current_url = preg_replace('#^http://#', 'https://', $current_url);
$ssl_url = $GLOBALS['config']->get('config', 'ssl_url');
if (preg_match('#^' . $ssl_url . '#', $current_url)) {
// Make sure the domain for SSL is expected
httpredir($current_url, '', false, 301);
} else {
// If not we try to make it based on what we have
$url_parts = parse_url($current_url);
$url_parts['path'] = str_replace($GLOBALS['config']->get('config', 'ssl_path'), '/', $url_parts['path']);
$ssl_url .= !empty($url_parts['path']) ? $url_parts['path'] : '';
$ssl_url .= !empty($url_parts['query']) ? '?' . $url_parts['query'] : '';
$anchor = !empty($url_parts['fragment']) ? '#' . $url_parts['fragment'] : '';
httpredir($ssl_url, $anchor, false, 301);
}
}
}
示例5: process
public function process()
{
$coinbase_order = $this->coinbase->call("orders/" . $_GET["order"]["uuid"])->data;
$order = Order::getInstance();
if ($coinbase_order->status == "mispaid") {
$order->orderStatus(Order::ORDER_PENDING, $this->order_number);
$order->paymentStatus(Order::PAYMENT_PENDING, $this->order_number);
$transData['notes'] = "Bitcoin payment mispaid";
$order->logTransaction($transData);
$GLOBALS['gui']->setError("Your Bitcoin payment was the incorrect amount. Please contact support to resolve your order.");
} elseif ($coinbase_order->status == "expired") {
$order->orderStatus(Order::ORDER_PENDING, $this->order_number);
$order->paymentStatus(Order::PAYMENT_PENDING, $this->order_number);
$transData['notes'] = "Bitcoin payment expired";
$order->logTransaction($transData);
$GLOBALS['gui']->setError("Your Bitcoin payment has expired before you could make your payment. Please contact support to resolve your order.");
} else {
$order->orderStatus(Order::ORDER_PROCESS, $this->order_number);
$order->paymentStatus(Order::PAYMENT_SUCCESS, $this->order_number);
$transData['notes'] = "Bitcoin payment successful";
$order->logTransaction($transData);
}
httpredir(currentPage(array('_g', 'type', 'cmd', 'module'), array('_a' => 'complete')));
}
示例6: die
<?php
/**
* CubeCart v6
* ========================================
* CubeCart is a registered trade mark of CubeCart Limited
* Copyright CubeCart Limited 2015. All rights reserved.
* UK Private Limited Company No. 5323904
* ========================================
* Web: http://www.cubecart.com
* Email: sales@cubecart.com
* License: GPL-3.0 https://www.gnu.org/licenses/quick-guide-gplv3.html
*/
if (!defined('CC_INI_SET')) {
die('Access Denied');
}
Admin::getInstance()->permissions('settings', CC_PERM_FULL, true);
global $lang, $glob;
$hash = randomString();
$file = CC_ROOT_DIR . '/files/hash.' . $hash . '.php';
$fp = fopen($file, 'w');
fwrite($fp, '<?php echo "' . $hash . '"; unlink("' . $file . '"); ?>');
fclose($fp);
httpredir('https://www.cubecart.com/store/auth/?hash=' . $hash . '&url=' . urlencode(CC_STORE_URL));
示例7: redirectToProductPage
/**
* Redirect to product page
*/
public function redirectToProductPage($productID)
{
if (isset($_GET['_g']) && $_GET['_g'] == 'ajaxadd') {
$GLOBALS['debug']->supress();
die('Redir:' . $GLOBALS['seo']->buildURL('prod', $productID));
} else {
httpredir("index.php?_a=product&product_id={$productID}");
}
}
示例8: foreach
$existing_languages = $db->select('CubeCart_email_content', 'DISTINCT `language`');
$missing_languages = $languages;
## Loop existing languages and remove to leave missing languages array with the ones we need to import
if ($existing_languages) {
foreach ($existing_languages as $key => $value) {
unset($missing_languages[$value['language']]);
}
}
## Import missing language email templates if they exist... pukka
if (is_array($missing_languages)) {
foreach ($missing_languages as $code => $lang) {
$language->importEmail('email_' . $code . '.xml');
}
}
// Set version number
if (!$GLOBALS['db']->select('CubeCart_history', false, array('version' => CC_VERSION))) {
$GLOBALS['db']->insert('CubeCart_history', array('version' => CC_VERSION, 'time' => time()));
}
## Progressive updates completed
## Redirect to the 'complete' page
$_SESSION['setup']['complete'] = true;
if ($_SESSION['setup']['autoupgrade']) {
httpredir('../admin.php?_g=maintenance&node=index#upgrade');
}
httpredir('index.php', 'upgraded');
}
$GLOBALS['smarty']->assign('LANG_UPGRADE_IN_PROGRESS', sprintf($strings['setup']['upgrade_in_progress'], $current, $version));
$GLOBALS['smarty']->append('MODE_UPGRADE_PROGRESS', true);
}
$GLOBALS['smarty']->assign('MODE_UPGRADE', true);
}
示例9: die
* ========================================
* CubeCart is a registered trade mark of CubeCart Limited
* Copyright CubeCart Limited 2015. All rights reserved.
* UK Private Limited Company No. 5323904
* ========================================
* Web: http://www.cubecart.com
* Email: sales@cubecart.com
* License: GPL-3.0 https://www.gnu.org/licenses/quick-guide-gplv3.html
*/
if (!defined('CC_INI_SET')) {
die('Access Denied');
}
Admin::getInstance()->permissions('statistics', CC_PERM_READ, true);
global $lang;
if (isset($_POST['select'])) {
httpredir(currentPage(null, $_POST['select']));
}
$select['year'] = isset($_GET['year']) && is_numeric($_GET['year']) ? (int) $_GET['year'] : date('Y');
$select['month'] = isset($_GET['month']) && in_array($_GET['month'], range(1, 12)) ? str_pad((int) $_GET['month'], 2, '0', STR_PAD_LEFT) : date('m');
$select['day'] = isset($_GET['day']) && in_array($_GET['day'], range(1, 31)) ? str_pad((int) $_GET['day'], 2, '0', STR_PAD_LEFT) : date('d');
$select['status'] = isset($_GET['status']) && in_array($_GET['status'], range(1, 6)) ? (int) $_GET['status'] : 3;
// Sales
$GLOBALS['main']->addTabControl($lang['statistics']['title_sales'], 'stats_sales');
$earliest_order = $GLOBALS['db']->select('CubeCart_order_summary', array('MIN' => 'order_date'), array('status' => $select['status']), array('order_date' => 'ASC'));
// $earliest_order will always return true but MIN_order_date may not have a value
$yearly = $monthly = $daily = $hourly = array();
if (!empty($earliest_order[0]['MIN_order_date'])) {
$earliest = array('year' => date('Y', $earliest_order[0]['MIN_order_date']), 'month' => date('m', $earliest_order[0]['MIN_order_date']), 'day' => date('d', $earliest_order[0]['MIN_order_date']));
$orders_all = $GLOBALS['db']->select('CubeCart_order_summary', array('total', 'cart_order_id', 'order_date'), array('status' => (int) $select['status']));
if ($orders_all) {
foreach ($orders_all as $key => $data) {
示例10: array
$filter['field'] = $_GET['field'];
$filter['sort'] = $_GET['sort'];
} else {
$filter['field'] = 'time';
$filter['sort'] = 'DESC';
}
if (!empty($_GET['keywords'])) {
$where = array('review' => '~' . $_GET['keywords']);
}
$reviews = $GLOBALS['db']->select('CubeCart_reviews', false, $where, array($filter['field'] => $filter['sort']), $per_page, $page);
if (isset($_GET['product_id']) && is_numeric($_GET['product_id'])) {
$product = $GLOBALS['db']->select('CubeCart_inventory', array('name'), array('product_id' => (int) $_GET['product_id']));
}
if (!$reviews && isset($product) && $product) {
$GLOBALS['main']->setACPWarning($lang['reviews']['error_reviews_none']);
httpredir(currentPage(array('product_id')), 'search');
}
if ($reviews) {
$GLOBALS['smarty']->assign('PAGINATION', $GLOBALS['db']->pagination(false, $per_page, $page, 9));
foreach ($reviews as $review) {
if (($product = $GLOBALS['db']->select('CubeCart_inventory', array('name'), array('product_id' => $review['product_id']))) !== false) {
$review['product'] = $product[0];
$review['date'] = formatTime($review['time']);
$review['delete'] = currentPage(null, array('delete' => (int) $review['id']));
$review['edit'] = currentPage(null, array('edit' => (int) $review['id']));
$smarty_data['reviews'][] = $review;
} else {
$GLOBALS['db']->delete('CubeCart_reviews', array('product_id' => $review['product_id']));
}
}
if (isset($smarty_data['reviews'])) {
示例11: die
* Copyright CubeCart Limited 2015. All rights reserved.
* UK Private Limited Company No. 5323904
* ========================================
* Web: http://www.cubecart.com
* Email: sales@cubecart.com
* License: GPL-3.0 https://www.gnu.org/licenses/quick-guide-gplv3.html
*/
if (!defined('CC_INI_SET')) {
die('Access Denied');
}
// Load admin user details
if (!isset($_GET['_g']) || !in_array(strtolower($_GET['_g']), array('login', 'logout', 'password', 'recovery'))) {
$GLOBALS['main']->setTemplate();
}
if (isset($_GET['_g']) && in_array($_GET['_g'], array('login', 'password', 'recovery'))) {
httpredir('?');
}
if (isset($_GET['_g']) && !empty($_GET['_g']) && $_GET['_g'] != 'plugins') {
$GLOBALS['gui']->addBreadcrumb(ucwords($_GET['_g']));
}
if (!empty($_GET['_g'])) {
$module_type = isset($_GET['type']) && preg_match("/[a-z]/i", $_GET['type']) ? $_GET['type'] : '';
$node = !empty($_GET['node']) ? strtolower($_GET['node']) : 'index';
if (!isset($_GET['delete']) && strtolower($_GET['_g']) == 'plugins' && !empty($module_type)) {
$module_type = preg_match("/[a-z]/i", $_GET['type']) ? $_GET['type'] : '';
$GLOBALS['gui']->addBreadcrumb($lang['navigation']['nav_plugins'], '?_g=plugins');
// Display Modules
$GLOBALS['main']->wikiNamespace('Modules');
if (!empty($_GET['module'])) {
// Load Module
$GLOBALS['main']->wikiPage($_GET['module']);
示例12: die
* CubeCart is a registered trade mark of CubeCart Limited
* Copyright CubeCart Limited 2015. All rights reserved.
* UK Private Limited Company No. 5323904
* ========================================
* Web: http://www.cubecart.com
* Email: sales@cubecart.com
* License: GPL-3.0 https://www.gnu.org/licenses/quick-guide-gplv3.html
*/
if (!defined('CC_INI_SET')) {
die('Access Denied');
}
Admin::getInstance()->permissions('orders', CC_PERM_READ, true);
$GLOBALS['main']->addTabControl($GLOBALS['language']->orders['title_transaction_logs'], 'logs');
$GLOBALS['gui']->addBreadcrumb($GLOBALS['language']->orders['title_transaction_logs']);
if (isset($_POST['search'])) {
httpredir(currentPage(null, array('search' => $_POST['search'])));
}
$per_page = 20;
$page = isset($_GET['page']) ? $_GET['page'] : 1;
if (isset($_GET['order_id'])) {
$GLOBALS['smarty']->assign('TRANSACTION_LOGS_TITLE', sprintf($GLOBALS['lang']['orders']['title_transaction_logs_for_order'], $_GET['order_id']));
if (($transactions = $GLOBALS['db']->select('CubeCart_transactions', false, array('order_id' => $_GET['order_id']), array('time' => 'DESC'))) !== false) {
$GLOBALS['gui']->addBreadcrumb($transactions[0]['order_id'], currentPage());
foreach ($transactions as $transaction) {
$transaction['time'] = formatTime($transaction['time']);
$transaction['amount'] = Tax::getInstance()->priceFormat($transaction['amount']);
$transaction['trans_id'] = empty($transaction['trans_id']) ? $GLOBALS['lang']['common']['null'] : $transaction['trans_id'];
$smarty_data['transactions'][] = $transaction;
}
$GLOBALS['smarty']->assign('ORDER_TRANSACTIONS', $smarty_data['transactions']);
}
示例13: currentPage
}
$GLOBALS['smarty']->assign('DISPLAY_SEND', true);
} else {
if (isset($_GET['action']) && in_array(strtolower($_GET['action']), array('add', 'edit'))) {
Admin::getInstance()->permissions('customers', CC_PERM_EDIT, true);
$GLOBALS['main']->addTabControl($lang['common']['general'], 'general');
$GLOBALS['main']->addTabControl($lang['email']['title_content_html'], 'email_html');
$GLOBALS['main']->addTabControl($lang['email']['title_content_text'], 'email_text');
$GLOBALS['main']->addTabControl($lang['email']['title_send_test'], 'send_test');
if (isset($_GET['newsletter_id']) && is_numeric($_GET['newsletter_id'])) {
if (($content = $GLOBALS['db']->select('CubeCart_newsletter', false, array('newsletter_id' => (int) $_GET['newsletter_id']))) !== false) {
// Render editor window
$GLOBALS['gui']->addBreadcrumb($content[0]['subject'], currentPage());
$GLOBALS['smarty']->assign('NEWSLETTER', $content[0]);
} else {
httpredir(currentPage(array('newsletter_id')));
}
}
// Get template list
if (($templates = $GLOBALS['db']->select('CubeCart_email_template', array('template_default', 'template_id', 'title'))) !== false) {
foreach ($templates as $template) {
if (isset($content)) {
$template['selected'] = $template['template_id'] == $content[0]['template_id'] ? ' selected="selected"' : '';
} else {
$template['selected'] = '';
}
$existing_templates[] = $template;
}
$GLOBALS['smarty']->assign('EXISTING_TEMPLATES', $existing_templates);
}
$GLOBALS['smarty']->assign('DISPLAY_FORM', true);
示例14: __construct
protected final function __construct()
{
// Turn error reporting off as it is displayed in debugger mode only!
ini_set('display_errors', false);
// Show ALL errors & notices
error_reporting(E_ALL ^ E_NOTICE);
ini_set('ignore_repeated_errors', true);
ini_set('ignore_repeated_source', true);
// Enable HTML Error messages
ini_set('html_errors', true);
ini_set('docref_root', 'http://docs.php.net/manual/en/');
ini_set('docref_ext', '.php');
// Define the Error & Exception handlers
set_error_handler(array(&$this, 'errorLogger'), ini_get('error_reporting'));
set_exception_handler(array(&$this, 'exceptionHandler'));
// Enable debugger
if (isset($GLOBALS['config']) && is_object($GLOBALS['config'])) {
$this->_enabled = (bool) $GLOBALS['config']->get('config', 'debug');
$ip_string = $GLOBALS['config']->get('config', 'debug_ip_addresses');
if (!empty($ip_string)) {
if (strstr($ip_string, ',')) {
$ip_addresses = explode(',', $ip_string);
if (!in_array(get_ip_address(), $ip_addresses)) {
$this->_enabled = false;
}
} else {
if ($ip_string !== get_ip_address()) {
$this->_enabled = false;
}
}
}
}
//If its time to clear the cache
if (isset($_GET['debug-cache-clear'])) {
$GLOBALS['cache']->clear();
$GLOBALS['cache']->tidy();
httpredir(currentPage(array('debug-cache-clear')));
}
//Check for xdebug
if (extension_loaded('xdebug') && function_exists('xdebug_is_enabled')) {
$this->_xdebug = xdebug_is_enabled();
}
$this->_debug_timer = $this->_getTime();
// Check register_globals
if (ini_get('register_globals')) {
trigger_error('register_globals are enabled. It is highly recommended that you disable this in your PHP configuration, as it is a large security hole, and may wreak havoc.', E_USER_WARNING);
}
Sanitize::cleanGlobals();
}
示例15: _load
/**
* Load customer data
*/
private function _load()
{
foreach ($GLOBALS['hooks']->load('class.user.load') as $hook) {
include $hook;
}
if ($GLOBALS['session']->session_data['customer_id'] == '0') {
return;
}
if ($GLOBALS['session']->session_data['customer_id'] && ($result = $GLOBALS['db']->select('CubeCart_customer', false, array('customer_id' => (int) $GLOBALS['session']->session_data['customer_id']), null, 1))) {
$this->_user_data = $result[0];
foreach ($GLOBALS['hooks']->load('class.user.load.user') as $hook) {
include $hook;
}
$this->_logged_in = true;
if (!$GLOBALS['session']->has('user_language', 'client')) {
$GLOBALS['session']->set('user_language', isset($result[0]['language']) && preg_match(Language::LANG_REGEX, $result[0]['language']) ? $result[0]['language'] : $GLOBALS['config']->get('config', 'default_language'), 'client');
}
if ((empty($this->_user_data['email']) || !filter_var($this->_user_data['email'], FILTER_VALIDATE_EMAIL) || empty($this->_user_data['first_name']) || empty($this->_user_data['last_name'])) && !in_array(strtolower($_GET['_a']), array('profile', 'logout'))) {
// Force account details page
$GLOBALS['session']->set('temp_profile_required', true);
httpredir(currentPage(null, array('_a' => 'profile')));
}
}
}