本文整理汇总了PHP中zen_session_id函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_session_id函数的具体用法?PHP zen_session_id怎么用?PHP zen_session_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zen_session_id函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: zen_update_whos_online
/**
* @package ZenCart_Functions
*/
function zen_update_whos_online()
{
global $db;
if ($_SESSION['customer_id']) {
$wo_customer_id = $_SESSION['customer_id'];
$customer_query = "select customers_firstname, customers_lastname\r\n from " . TABLE_CUSTOMERS . "\r\n where customers_id = '" . (int) $_SESSION['customer_id'] . "'";
$customer = $db->Execute($customer_query);
$wo_full_name = $customer->fields['customers_firstname'] . ' ' . $customer->fields['customers_lastname'];
} else {
$wo_customer_id = '';
$wo_full_name = 'Guest';
}
$wo_session_id = zen_session_id();
$wo_ip_address = $_SERVER['REMOTE_ADDR'];
$wo_last_page_url = $_SERVER['REQUEST_URI'];
$wo_user_agent = zen_db_prepare_input($_SERVER['HTTP_USER_AGENT']);
$current_time = time();
$xx_mins_ago = $current_time - 900;
// remove entries that have expired
$sql = "delete from " . TABLE_WHOS_ONLINE . "\r\n where time_last_click < '" . $xx_mins_ago . "'";
$db->Execute($sql);
$stored_customer_query = "select count(*) as count\r\n from " . TABLE_WHOS_ONLINE . "\r\n where session_id = '" . zen_db_input($wo_session_id) . "'";
$stored_customer = $db->Execute($stored_customer_query);
if ($stored_customer->fields['count'] > 0) {
$sql = "update " . TABLE_WHOS_ONLINE . "\r\n set customer_id = '" . (int) $wo_customer_id . "',\r\n full_name = '" . zen_db_input($wo_full_name) . "',\r\n ip_address = '" . zen_db_input($wo_ip_address) . "',\r\n time_last_click = '" . zen_db_input($current_time) . "',\r\n last_page_url = '" . zen_db_input($wo_last_page_url) . "',\r\n host_address = '" . zen_db_input($_SESSION['customers_host_address']) . "',\r\n user_agent = '" . zen_db_input($wo_user_agent) . "'\r\n where session_id = '" . zen_db_input($wo_session_id) . "'";
$db->Execute($sql);
} else {
$sql = "insert into " . TABLE_WHOS_ONLINE . "\r\n (customer_id, full_name, session_id, ip_address, time_entry,\r\n time_last_click, last_page_url, host_address, user_agent)\r\n values ('" . (int) $wo_customer_id . "', '" . zen_db_input($wo_full_name) . "', '" . zen_db_input($wo_session_id) . "', '" . zen_db_input($wo_ip_address) . "', '" . zen_db_input($current_time) . "', '" . zen_db_input($current_time) . "', '" . zen_db_input($wo_last_page_url) . "', '" . zen_db_input($_SESSION['customers_host_address']) . "', '" . zen_db_input($wo_user_agent) . "')";
$db->Execute($sql);
}
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:34,代码来源:whos_online.php
示例2: zen_update_whos_online
/**
* @package ZenCart_Functions
*/
function zen_update_whos_online()
{
global $gBitDb;
if (!empty($_SESSION['customer_id'])) {
$wo_customer_id = $_SESSION['customer_id'];
$customer_query = "select `customers_firstname`, `customers_lastname`\n from " . TABLE_CUSTOMERS . "\n where `customers_id` = '" . (int) $_SESSION['customer_id'] . "'";
$customer = $gBitDb->Execute($customer_query);
$wo_full_name = $customer->fields['customers_firstname'] . ' ' . $customer->fields['customers_lastname'];
} else {
$wo_customer_id = '';
$wo_full_name = 'Guest';
}
$wo_session_id = zen_session_id();
$wo_ip_address = $_SERVER['REMOTE_ADDR'];
$wo_last_page_url = $_SERVER['REQUEST_URI'];
$wo_user_agent = !empty($_SERVER['HTTP_USER_AGENT']) ? zen_db_prepare_input($_SERVER['HTTP_USER_AGENT']) : '-';
$current_time = time();
$xx_mins_ago = $current_time - 900;
// remove entries that have expired
$sql = "delete from " . TABLE_WHOS_ONLINE . "\n where `time_last_click` < '" . $xx_mins_ago . "'";
$gBitDb->Execute($sql);
$stored_customer_query = 'select count(*) as "count"
from ' . TABLE_WHOS_ONLINE . "\n where `session_id` = '" . zen_db_input($wo_session_id) . "'";
$stored_customer = $gBitDb->Execute($stored_customer_query);
if (empty($wo_customer_id)) {
$wo_customer_id = NULL;
}
if ($stored_customer->fields['count'] > 0) {
$sql = "update " . TABLE_WHOS_ONLINE . "\n set `customer_id` = ?, `full_name` = ?, `ip_address` = ?, `time_last_click` = ?, `last_page_url` = ?, `host_address` = ?, `user_agent` = ?\n where `session_id` = ?";
$gBitDb->query($sql, array($wo_customer_id, $wo_full_name, $wo_ip_address, $current_time, substr($wo_last_page_url, 0, 255), $_SESSION['customers_host_address'], substr($wo_user_agent, 0, 255), $wo_session_id));
} else {
$sql = "insert into " . TABLE_WHOS_ONLINE . "\n (`customer_id`, `full_name`, `session_id`, `ip_address`, `time_entry`,\n `time_last_click`, `last_page_url`, `host_address`, `user_agent`)\n values ( ?, ?, ?, ?, ?, ?, ?, ?, ? )";
$gBitDb->query($sql, array($wo_customer_id, $wo_full_name, $wo_session_id, $wo_ip_address, $current_time, $current_time, $wo_last_page_url, $_SESSION['customers_host_address'], $wo_user_agent));
}
}
开发者ID:bitweaver,项目名称:commerce,代码行数:38,代码来源:whos_online.php
示例3: process_button
public function process_button()
{
$process_button_string = '<input type="hidden" name="cc_owner" value = "' . $_POST['checkoutapipayment_cc_owner'] . '">';
$process_button_string .= '<input type="hidden" name="cc_expires_month" value = "' . $_POST['checkoutapipayment_cc_expires_month'] . '">';
$process_button_string .= '<input type="hidden" name="cc_expires_year" value = "' . $_POST['checkoutapipayment_cc_expires_year'] . '">';
$process_button_string .= '<input type="hidden" name="cc_number" value = "' . $_POST['checkoutapipayment_cc_number'] . '">';
$process_button_string .= '<input type="hidden" name="cc_cvv" value = "' . $_POST['checkoutapipayment_cc_cvv'] . '">';
$process_button_string .= '<input type="hidden" name="' . zen_session_name() . '" value = "' . zen_session_id() . '">';
echo $process_button_string;
return $process_button_string;
}
开发者ID:avish-bisbeehurry-cko,项目名称:checkout-zencart-plugin,代码行数:11,代码来源:creditcardpci.php
示例4: process_button
/**
* @return string
*/
public function process_button()
{
$sid = zen_session_name() . '=' . zen_session_id();
$formEntries = $this->buildStandardTransactionDetails();
$formEntries['SuccessURL'] = str_replace('&', '&', zen_href_link(FILENAME_CHECKOUT_PROCESS, $sid, 'SSL', false));
$formEntries['FailureURL'] = str_replace('&', '&', zen_href_link(FILENAME_CHECKOUT_PROCESS, $sid, 'SSL', false));
$processButtonString = SagepayUtil::processCryptEntries($formEntries);
$crypt = SagepayUtil::encryptAndEncode($processButtonString, MODULE_PAYMENT_SAGEPAY_ZC_FORM_PASSWORD);
$transaction_type = strtoupper(MODULE_PAYMENT_SAGEPAY_ZC_FORM_TXTYPE);
$this->errorLog(array(array('title' => 'Transaction Type', 'content' => $transaction_type), array('title' => 'Submit Data', 'content' => $processButtonString)));
$process_button_string = zen_draw_hidden_field('VPSProtocol', self::SP_PROTOCOL_VERSION) . zen_draw_hidden_field('TxType', $transaction_type) . zen_draw_hidden_field('Vendor', MODULE_PAYMENT_SAGEPAY_ZC_FORM_VENDOR_NAME) . zen_draw_hidden_field('ReferrerID', 'BB5F9F0D-8982-4203-AFD4-AF78017E4B92') . zen_draw_hidden_field('Crypt', $crypt);
return $process_button_string;
}
开发者ID:zencart,项目名称:sagepay,代码行数:16,代码来源:sagepay_zc_form.php
示例5: zen_update_whos_online
/**
* zen_update_whos_online
*/
function zen_update_whos_online()
{
global $db;
if (isset($_SESSION['customer_id']) && $_SESSION['customer_id']) {
$wo_customer_id = $_SESSION['customer_id'];
$customer_query = "select customers_firstname, customers_lastname\n from " . TABLE_CUSTOMERS . "\n where customers_id = '" . (int) $_SESSION['customer_id'] . "'";
$customer = $db->Execute($customer_query);
$wo_full_name = $customer->fields['customers_lastname'] . ', ' . $customer->fields['customers_firstname'];
} else {
$wo_customer_id = '';
$wo_full_name = '¥' . 'Guest';
}
$wo_session_id = zen_session_id();
$wo_ip_address = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : 'Unknown';
$wo_user_agent = substr(zen_db_prepare_input($_SERVER['HTTP_USER_AGENT']), 0, 254);
$_SERVER['QUERY_STRING'] = isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '' ? $_SERVER['QUERY_STRING'] : zen_get_all_get_params();
if (isset($_SERVER['REQUEST_URI'])) {
$uri = $_SERVER['REQUEST_URI'];
} else {
if (isset($_SERVER['QUERY_STRING'])) {
$uri = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];
} else {
$uri = $_SERVER['PHP_SELF'] . '?' . $_SERVER['argv'][0];
}
}
if (substr($uri, -1) == '?') {
$uri = substr($uri, 0, strlen($uri) - 1);
}
$wo_last_page_url = zen_not_null($uri) ? substr($uri, 0, 254) : 'Unknown';
$current_time = time();
$xx_mins_ago = $current_time - 900;
// remove entries that have expired
$sql = "delete from " . TABLE_WHOS_ONLINE . "\n where time_last_click < '" . $xx_mins_ago . "'";
$db->Execute($sql);
$stored_customer_query = "select count(*) as count\n from " . TABLE_WHOS_ONLINE . "\n where session_id = '" . zen_db_input($wo_session_id) . "' and ip_address='" . zen_db_input($wo_ip_address) . "'";
$stored_customer = $db->Execute($stored_customer_query);
if (empty($wo_session_id)) {
$wo_full_name = '¥' . 'Spider';
}
if ($stored_customer->fields['count'] > 0) {
$sql = "update " . TABLE_WHOS_ONLINE . "\n set customer_id = '" . (int) $wo_customer_id . "',\n full_name = '" . zen_db_input($wo_full_name) . "',\n ip_address = '" . zen_db_input($wo_ip_address) . "',\n time_last_click = '" . zen_db_input($current_time) . "',\n last_page_url = '" . zen_db_input($wo_last_page_url) . "',\n host_address = '" . zen_db_input($_SESSION['customers_host_address']) . "',\n user_agent = '" . zen_db_input($wo_user_agent) . "'\n where session_id = '" . zen_db_input($wo_session_id) . "' and ip_address='" . zen_db_input($wo_ip_address) . "'";
$db->Execute($sql);
} else {
$sql = "insert into " . TABLE_WHOS_ONLINE . "\n (customer_id, full_name, session_id, ip_address, time_entry,\n time_last_click, last_page_url, host_address, user_agent)\n values ('" . (int) $wo_customer_id . "', '" . zen_db_input($wo_full_name) . "', '" . zen_db_input($wo_session_id) . "', '" . zen_db_input($wo_ip_address) . "', '" . zen_db_input($current_time) . "', '" . zen_db_input($current_time) . "', '" . zen_db_input($wo_last_page_url) . "', '" . zen_db_input($_SESSION['customers_host_address']) . "', '" . zen_db_input($wo_user_agent) . "')";
$db->Execute($sql);
}
}
开发者ID:andychang88,项目名称:daddy-store.com,代码行数:50,代码来源:whos_online.php
示例6: zen_href_link_admin
function zen_href_link_admin($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true)
{
global $request_type, $session_started, $http_domain, $https_domain;
if ($page == '') {
bt();
die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>Function used:<br><br>zen_href_link_admin(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>');
}
if ($connection == 'NONSSL') {
$link = HTTP_SERVER . DIR_WS_ADMIN;
} elseif ($connection == 'SSL') {
$link = HTTPS_SERVER . DIR_WS_HTTPS_ADMIN;
} else {
die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL<br><br>Function used:<br><br>zen_href_link_admin(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>');
}
if (!strstr($page, '.php')) {
$page .= '.php';
}
if ($parameters == '') {
$link = $link . $page;
$separator = '?';
} else {
$link = $link . $page . '?' . $parameters;
$separator = '&';
}
while (substr($link, -1) == '&' || substr($link, -1) == '?') {
$link = substr($link, 0, -1);
}
// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
if ($add_session_id == true && $session_started == true) {
if (defined('SID') && zen_not_null(SID)) {
$sid = SID;
} elseif ($request_type == 'NONSSL' && $connection == 'SSL' && ENABLE_SSL_ADMIN == 'true' || $request_type == 'SSL' && $connection == 'NONSSL') {
//die($connection);
if ($http_domain != $https_domain) {
$sid = zen_session_name() . '=' . zen_session_id();
}
}
}
if (isset($sid)) {
$link .= $separator . $sid;
}
return $link;
}
开发者ID:bitweaver,项目名称:commerce,代码行数:43,代码来源:html_output.php
示例7: processPayment
function processPayment(&$pPaymentParameters, &$pOrder)
{
global $_POST, $response, $gBitDb, $order;
if (MODULE_PAYMENT_AUTHORIZENET_AIM_STORE_NUMBER == 'True') {
$order->info['cc_number'] = $_POST['cc_number'];
}
$order->info['cc_expires'] = $_POST['cc_expires'];
$order->info['cc_type'] = $_POST['cc_type'];
$order->info['cc_owner'] = $_POST['cc_owner'];
$order->info['cc_cvv'] = $_POST['cc_cvv'];
// DATA PREPARATION SECTION
unset($submit_data);
// Cleans out any previous data stored in the variable
// Create a string that contains a listing of products ordered for the description field
$description = '';
foreach (array_keys($order->contents) as $opid) {
$description .= $order->contents[$opid]['name'] . '(qty: ' . $order->contents[$opid]['quantity'] . ') + ';
}
// Remove the last "\n" from the string
$description = substr($description, 0, -2);
// Create a variable that holds the order time
$order_time = date("F j, Y, g:i a");
// Calculate the next expected order id
$last_order_id = $gBitDb->getOne("select * from " . TABLE_ORDERS . " order by `orders_id` desc");
$new_order_id = $last_order_id->fields['orders_id'];
$new_order_id = $new_order_id + 1;
// Populate an array that contains all of the data to be sent to Authorize.net
$submit_data = array(x_login => MODULE_PAYMENT_AUTHORIZENET_AIM_LOGIN, x_tran_key => MODULE_PAYMENT_AUTHORIZENET_AIM_TXNKEY, x_relay_response => 'FALSE', x_delim_data => 'TRUE', x_version => '3.1', x_type => MODULE_PAYMENT_AUTHORIZENET_AIM_AUTHORIZATION_TYPE == 'Authorize' ? 'AUTH_ONLY' : 'AUTH_CAPTURE', x_method => 'CC', x_amount => number_format($order->info['total'], 2), x_card_num => $_POST['cc_number'], x_exp_date => $_POST['cc_expires'], x_card_code => $_POST['cc_cvv'], x_email_customer => MODULE_PAYMENT_AUTHORIZENET_AIM_EMAIL_CUSTOMER == 'True' ? 'TRUE' : 'FALSE', x_email_merchant => MODULE_PAYMENT_AUTHORIZENET_AIM_EMAIL_MERCHANT == 'True' ? 'TRUE' : 'FALSE', x_cust_id => $_SESSION['customer_id'], x_invoice_num => $new_order_id, x_first_name => $order->billing['firstname'], x_last_name => $order->billing['lastname'], x_company => $order->billing['company'], x_address => $order->billing['street_address'], x_city => $order->billing['city'], x_state => $order->billing['state'], x_zip => $order->billing['postcode'], x_country => $order->billing['country']['title'], x_phone => $order->customer['telephone'], x_email => $order->customer['email_address'], x_ship_to_first_name => $order->delivery['firstname'], x_ship_to_last_name => $order->delivery['lastname'], x_ship_to_address => $order->delivery['street_address'], x_ship_to_city => $order->delivery['city'], x_ship_to_state => $order->delivery['state'], x_ship_to_zip => $order->delivery['postcode'], x_ship_to_country => $order->delivery['country']['title'], x_description => $description, Date => $order_time, IP => $_SERVER['REMOTE_ADDR'], Session => zen_session_id());
if (MODULE_PAYMENT_AUTHORIZENET_AIM_TESTMODE == 'Test') {
$submit_data['x_test_request'] = 'TRUE';
}
// concatenate the submission data and put into variable $data
while (list($key, $value) = each($submit_data)) {
$data .= $key . '=' . urlencode(str_replace(',', '', $value)) . '&';
}
// Remove the last "&" from the string
$data = substr($data, 0, -1);
// SEND DATA BY CURL SECTION
// Post order info data to Authorize.net, make sure you have curl installed
unset($response);
// The commented line below is an alternate connection method
//exec("/usr/bin/curl -d \"$data\" https://secure.authorize.net/gateway/transact.dll", $response);
$url = 'https://secure.authorize.net/gateway/transact.dll';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$authorize = curl_exec($ch);
curl_close($ch);
$response = split('\\,', $authorize);
// DATABASE SECTION
// Insert the send and receive response data into the database.
// This can be used for testing or for implementation in other applications
// This can be turned on and off if the Admin Section
if (MODULE_PAYMENT_AUTHORIZENET_AIM_STORE_DATA == 'True') {
// Create a string from all of the response data for insertion into the database
while (list($key, $value) = each($response)) {
$response_list .= $key + 1 . '=' . urlencode(ereg_replace(',', '', $value)) . '&';
}
// Remove the last "&" from the string
$response_list = substr($response_list, 0, -1);
$response_code = explode(',', $response[0]);
$response_text = explode(',', $response[3]);
$transaction_id = explode(',', $response[6]);
$authorization_type = explode(',', $response[11]);
$db_response_code = $response_code[0];
$db_response_text = $response_text[0];
$db_transaction_id = $transaction_id[0];
$db_authorization_type = $authorization_type[0];
$db_session_id = zen_session_id();
// Insert the data into the database
$gBitDb->Execute("INSERT INTO " . TABLE_AUTHORIZENET . " (`id`, `customer_id`, `order_id`, `response_code`, `response_text`, `authorization_type`, `transaction_id`, `sent`, `received`, `az_time`, `session_id`) VALUES ('', '" . $_SESSION['customer_id'] . "', '" . $new_order_id . "', '" . $db_response_code . "', '" . $db_response_text . "', '" . $db_authorization_type . "', '" . $db_transaction_id . "', '" . $data . "', '" . $response_list . "', '" . $order_time . "', '" . $db_session_id . "')");
}
// Parse the response code and text for custom error display
$response_code = explode(',', $response[0]);
$response_text = explode(',', $response[3]);
$x_response_code = $response_code[0];
$x_response_text = $response_text[0];
// If the response code is not 1 (approved) then redirect back to the payment page with the appropriate error message
if ($x_response_code != '1') {
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . $x_response_text . ' - ' . urlencode(MODULE_PAYMENT_AUTHORIZENET_AIM_TEXT_DECLINED_MESSAGE), 'SSL', true, false));
}
}
开发者ID:bitweaver,项目名称:commerce,代码行数:85,代码来源:authorizenet_aim.php
示例8: process_button
function process_button()
{
$process_button_string = zen_draw_hidden_field('cc_owner', $_POST['linkpoint_api_cc_owner']) . zen_draw_hidden_field('cc_expires', $this->cc_expiry_month . substr($this->cc_expiry_year, -2)) . zen_draw_hidden_field('cc_expires_month', $this->cc_expiry_month) . zen_draw_hidden_field('cc_expires_year', substr($this->cc_expiry_year, -2)) . zen_draw_hidden_field('cc_type', $this->cc_card_type) . zen_draw_hidden_field('cc_number', $this->cc_card_number) . zen_draw_hidden_field('cc_cvv', $_POST['linkpoint_api_cc_cvv']);
$process_button_string .= zen_draw_hidden_field(zen_session_name(), zen_session_id());
return $process_button_string;
}
开发者ID:kirkbauer2,项目名称:kirkzc,代码行数:6,代码来源:linkpoint_api.php
示例9: display_links
function display_links($query_numrows, $max_rows_per_page, $max_page_links, $current_page_number, $parameters = '', $page_name = 'page')
{
global $PHP_SELF;
$current_page_number = (int) $current_page_number;
if (zen_not_null($parameters) && substr($parameters, -1) != '&') {
$parameters .= '&';
}
if ($max_rows_per_page == 0) {
$max_rows_per_page = 20;
}
if ($query_numrows == 0) {
return '';
}
// calculate number of pages needing links
if ($max_rows_per_page == '' || $max_rows_per_page == 0) {
$max_rows_per_page = $query_numrows;
}
$num_pages = ceil($query_numrows / $max_rows_per_page);
$pages_array = array();
for ($i = 1; $i <= $num_pages; $i++) {
$pages_array[] = array('id' => $i, 'text' => $i);
}
if ($num_pages > 1) {
$display_links = zen_draw_form('pages', basename($PHP_SELF), '', 'get');
if ($current_page_number > 1) {
$display_links .= '<a href="' . zen_href_link(basename($PHP_SELF), $parameters . $page_name . '=' . ($current_page_number - 1), 'NONSSL') . '" class="splitPageLink">' . PREVNEXT_BUTTON_PREV . '</a> ';
} else {
$display_links .= PREVNEXT_BUTTON_PREV . ' ';
}
$display_links .= sprintf(TEXT_RESULT_PAGE, zen_draw_pull_down_menu($page_name, $pages_array, $current_page_number, 'onChange="this.form.submit();"'), $num_pages);
if ($current_page_number < $num_pages && $num_pages != 1) {
$display_links .= ' <a href="' . zen_href_link(basename($PHP_SELF), $parameters . $page_name . '=' . ($current_page_number + 1), 'NONSSL') . '" class="splitPageLink">' . PREVNEXT_BUTTON_NEXT . '</a>';
} else {
$display_links .= ' ' . PREVNEXT_BUTTON_NEXT;
}
if ($parameters != '') {
if (substr($parameters, -1) == '&') {
$parameters = substr($parameters, 0, -1);
}
$pairs = explode('&', $parameters);
while (list(, $pair) = each($pairs)) {
list($key, $value) = explode('=', $pair);
$display_links .= zen_draw_hidden_field(rawurldecode($key), rawurldecode($value));
}
}
if (SID) {
$display_links .= zen_draw_hidden_field(zen_session_name(), zen_session_id());
}
$display_links .= '</form>';
} else {
$display_links = sprintf(TEXT_RESULT_PAGE, $num_pages, $num_pages);
}
return $display_links;
}
开发者ID:kirkbauer2,项目名称:kirkzc,代码行数:54,代码来源:split_page_results.php
示例10: zen_session_id
action="<?php
echo $_SESSION['3Dsecure_acsURL'];
?>
">
<input type=hidden name="PaReq"
value="<?php
echo $_SESSION['3Dsecure_payload'];
?>
"> <input
type=hidden name="TermUrl"
value="<?php
echo $_SESSION['3Dsecure_term_url'];
?>
"> <input
type=hidden name="MD" value="<?php
echo zen_session_id();
?>
">
<noscript>
<br>
<br>
<center>
<font color="red">
<h1>Processing your Payer Authentication Transaction</h1>
<h2>
JavaScript is currently disabled or is not supported by your
browser.<br>
</h2>
<h3>Please click Submit to continue the processing of your
transaction.</h3>
</font> <input type="submit" value="Submit">
开发者ID:wwxgitcat,项目名称:zencart_v1.0,代码行数:31,代码来源:header_php.php
示例11: before_process
/**
* Store the CC info to the order and process any results that come back from the payment gateway
*
*/
function before_process()
{
global $messageStack;
$this->authorize = $_POST;
unset($this->authorize['btn_submit_x'], $this->authorize['btn_submit_y']);
$this->authorize['HashValidationValue'] = $this->calc_md5_response($this->authorize['x_trans_id'], $this->authorize['x_amount']);
$this->authorize['HashMatchStatus'] = $this->authorize['x_MD5_Hash'] == $this->authorize['HashValidationValue'] ? 'PASS' : 'FAIL';
$this->_debugActions($this->authorize, 'Response-Data', '', zen_session_id());
// if in 'echo' mode, dump the returned data to the browser and stop execution
if (AUTHORIZENET_DEVELOPER_MODE == 'echo' || MODULE_PAYMENT_AUTHORIZENET_DEBUGGING == 'echo') {
echo 'Returned Response Codes:<br /><pre>' . print_r($_POST, true) . '</pre><br />';
die('Press the BACK button in your browser to return to the previous page.');
}
if ($this->authorize['x_response_code'] == '1' && $this->authorize['x_MD5_Hash'] == $this->authorize['HashValidationValue']) {
$this->auth_code = $this->authorize['x_auth_code'];
$this->transaction_id = $this->authorize['x_trans_id'];
return;
}
if ($this->authorize['x_response_code'] == '2') {
$messageStack->add_session('checkout_payment', $this->authorize['x_response_reason_text'] . MODULE_PAYMENT_AUTHORIZENET_TEXT_DECLINED_MESSAGE, 'error');
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));
}
// Code 3 or anything else is an error
$messageStack->add_session('checkout_payment', MODULE_PAYMENT_AUTHORIZENET_TEXT_ERROR_MESSAGE, 'error');
zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));
}
开发者ID:dalinhuang,项目名称:yijinhuanxiang,代码行数:30,代码来源:authorizenet.php
示例12: zen_session_id
$sql = "SELECT * FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE session_id = '" . zen_session_id() . "' LIMIT 1";
if (!($result = $db->Execute($sql))) {
$error = true;
$entry_antirobotreg_error = true;
$text_antirobotreg_error = ERROR_VALIDATION_1;
$messageStack->add('create_account', ERROR_VALIDATION_1);
} else {
$entry_antirobotreg_error = false;
$antirobotrow = $db->Execute($sql);
if (strtolower($_POST['antirobotreg']) != $antirobotrow->fields['reg_key'] or $antirobotrow->fields['reg_key'] == '') {
$error = true;
$entry_antirobotreg_error = true;
$text_antirobotreg_error = ERROR_VALIDATION_2;
$messageStack->add('create_account', ERROR_VALIDATION_2);
} else {
$sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE session_id = '" . zen_session_id() . "'";
if (!($result = $db->Execute($sql))) {
$error = true;
$entry_antirobotreg_error = true;
$text_antirobotreg_error = ERROR_VALIDATION_3;
$messageStack->add('create_account', ERROR_VALIDATION_3);
} else {
$sql = "OPTIMIZE TABLE " . TABLE_ANTI_ROBOT_REGISTRATION . "";
if (!($result = $db->Execute($sql))) {
$error = true;
$entry_antirobotreg_error = true;
$text_antirobotreg_error = ERROR_VALIDATION_4;
$messageStack->add('create_account', ERROR_VALIDATION_4);
} else {
$entry_antirobotreg_error = false;
}
开发者ID:Southern-Exposure-Seed-Exchange,项目名称:Zencart-Bootstrap-Theme,代码行数:31,代码来源:create_account.php
示例13: convertToMobileLink
function convertToMobileLink($href_link)
{
if ($this->isMobile()) {
$href_link = ereg_replace('&', '&', $href_link);
if (zen_session_id() && !strstr($href_link, zen_session_name() . '=' . zen_session_id())) {
if (!strstr($href_link, '?')) {
$href_link .= '?';
}
$href_link .= '&' . zen_session_name() . '=' . zen_session_id();
}
// EUC-JP to SJIS
if (strpos($href_link, '?') != false) {
$path = substr($href_link, 0, strpos($href_link, '?') + 1);
$query = substr($href_link, strpos($href_link, '?') + 1);
$sjis_key_val_pairs = array();
$key_val_pairs = split("&", $query);
foreach ($key_val_pairs as $key_val_pair) {
list($key, $val) = split("=", $key_val_pair);
$key = rawurlencode(mb_convert_encoding(rawurldecode($key), 'SJIS', 'EUC-JP'));
$val = rawurlencode(mb_convert_encoding(rawurldecode($val), 'SJIS', 'EUC-JP'));
$sjis_key_val_pairs[] = sprintf("%s=%s", $key, $val);
}
$sjis_query = join("&", $sjis_key_val_pairs);
$href_link = $path . $sjis_query;
}
}
return $href_link;
}
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:28,代码来源:Mobile.php
示例14: htmlspecialchars
<td class="headerInfo"><?php
echo htmlspecialchars($_GET['info_message']);
?>
</td>
</tr>
</table>
<?php
}
?>
<?php
if (isset($_SESSION['SSL_SESSION_ID'])) {
$show_session_expire = $db->Execute("select * from " . TABLE_SESSIONS . " where sessions_id= '" . $_SESSION['SSL_SESSION_ID'] . "'");
}
echo '<br /><strong>TESTING INFO:</strong> Time page: <strong>' . $_GET['main_page'] . '</strong> was loaded is: <strong>' . date('H:i:s', time()) . '</strong><br /><br />';
echo 'Session ID: ' . zen_session_id() . '<br / >';
echo 'REGISTERED GLOBALS is: <strong>' . (ini_get('register_globals') == '1' ? 'ON' : 'OFF') . '</strong>' . ' Session Timeout: <strong>' . ini_get('session.gc_maxlifetime') . 's</strong><br /><br />';
echo "GLOBALS[{$main_page}] and HTTP_GET_VARS['main_page'] and _GET['main_page'] = " . $GLOBALS['main_page'] . ' - ' . $_GET['main_page'] . ' - ' . $_GET['main_page'] . '<br /><br />';
echo "_SERVER['PHP_SELF'] and _GET['PHP_SELF'] and PHP_SELF and _SESSION['PHP_SELF'] = " . $_SERVER['PHP_SELF'] . ' - ' . $_GET['PHP_SELF'] . ' - ' . $PHP_SELF . ' - ' . $_SESSION['PHP_SELF'] . '<br /><br />';
echo "getenv('REQUEST_URI') = " . getenv('REQUEST_URI') . '<br /><br />';
echo 'SERVER_NAME = ' . $_SERVER['SERVER_NAME'] . '<br /><br />';
echo 'SCRIPT_FILENAME = ' . $_SERVER['SCRIPT_FILENAME'] . '<br /><br />';
echo 'HTTP_REFERER = ' . $_SERVER['HTTP_REFERER'] . '<br /><br />';
echo 'template_dir = ' . $template_dir . '<br /><br />';
echo '$cPath=' . $cPath . '<br /><br />';
echo '<strong>TEST LANGUAGE ' . TEST_LANGUAGE . '</strong><br /><br />';
if (strstr($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME'])) {
echo 'SERVER_NAME within HTTP_REFERER - Yes' . '<br />';
} else {
echo 'SERVER_NAME within HTTP_REFERER - No' . '<br />';
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:tpl_header_test_info.php
示例15: process_button
/**
* Build the data and actions to process when the "Submit" button is pressed on the order-confirmation screen.
* This sends the data to the payment gateway for processing.
* (These are hidden fields on the checkout confirmation page)
*
* @return string
*/
function process_button()
{
global $order, $db;
$this->order_id = md5(serialize($order->products) . '' . serialize($order->customer) . '' . serialize($order->delivery));
$_SESSION['order_id'] = $this->order_id;
$sql = sprintf("insert into " . TABLE_PAGAMASTARDE . " (order_id) values ('%s')", $this->order_id);
$db->Execute($sql);
$base_url = dirname(sprintf("%s://%s%s", isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http', $_SERVER['SERVER_NAME'], $_SERVER['REQUEST_URI']));
$callback_url = $base_url . '/ext/modules/payment/pagamastarde/callback.php';
$pagamastarde_ok_url = htmlspecialchars_decode(zen_href_link(FILENAME_CHECKOUT_PROCESS, 'action=confirm', 'SSL', true, false));
$pagamastarde_nok_url = trim(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL', false));
$cancelled_url = trim(zen_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false));
$amount = number_format($order->info['total'] * 100, 0, '', '');
$currency = $_SESSION['currency'];
$currency = 'EUR';
if (MODULE_PAYMENT_PAGAMASTARDE_DISCOUNT == 'False') {
$discount = 'false';
} else {
$discount = 'true';
}
if (MODULE_PAYMENT_PAGAMASTARDE_TESTMODE == 'Test') {
$secret_key = MODULE_PAYMENT_PAGAMASTARDE_TSK;
$public_key = MODULE_PAYMENT_PAGAMASTARDE_TK;
} else {
$secret_key = MODULE_PAYMENT_PAGAMASTARDE_PSK;
$public_key = MODULE_PAYMENT_PAGAMASTARDE_PK;
}
$message = $secret_key . $public_key . $this->order_id . $amount . $currency . $pagamastarde_ok_url . $pagamastarde_nok_url . $callback_url . $discount . $cancelled_url;
$signature = hash('sha512', $message);
// extra parameters for logged users
$sign_up = '';
$dob = '';
$order_total = 0;
$order_count = 0;
if (trim($_SESSION['customer_id']) != '') {
$sql = sprintf("SELECT *\r\n FROM %s\r\n JOIN %s ON customers_info.customers_info_id = customers.customers_id\r\n Where customers.customers_id = %d", TABLE_CUSTOMERS, TABLE_CUSTOMERS_INFO, $_SESSION['customer_id']);
$check = $db->Execute($sql);
while (!$check->EOF) {
$sign_up = substr($check->fields['customers_info_date_account_created'], 0, 10);
$dob = substr($check->fields['customers_dob'], 0, 10);
$check->MoveNext();
}
$sql = sprintf("select * from %s join %s on orders_status.orders_status_id = orders.orders_status\r\n where customers_id=%d\r\n and orders_status.orders_status_name in ('Processing','Delivered')\r\n order by orders_id", TABLE_ORDERS_STATUS, TABLE_ORDERS, $_SESSION['customer_id']);
$check = $db->Execute($sql);
while (!$check->EOF) {
$order_total += $check->fields['order_total'];
$order_count += 1;
$check->MoveNext();
}
}
$submit_data = array('order_id' => $this->order_id, 'email' => $order->customer['email_address'], 'full_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'], 'amount' => $amount, 'currency' => $currency, 'ok_url' => $pagamastarde_ok_url, 'nok_url' => $pagamastarde_nok_url, 'cancelled_url' => $cancelled_url, 'account_id' => $public_key, 'signature' => $signature, 'address[street]' => $order->customer['street_address'], 'address[city]' => $order->customer['city'], 'address[province]' => $order->customer['state'], 'address[zipcode]' => $order->customer['postcode'], 'shipping[street]' => $order->delivery['street_address'], 'shipping[city]' => $order->delivery['city'], 'shipping[province]' => $order->delivery['state'], 'shipping[zipcode]' => $order->delivery['postcode'], 'callback_url' => $callback_url, 'discount[full]' => $discount, 'mobile_phone' => $order->customer['telephone'], 'metadata[num_orders]' => $order_count, 'metadata[amount_orders]' => $order_total, 'dob' => $dob, 'metadata[member_since]' => $sign_up);
//product descirption
$desciption = [];
$i = 0;
if (isset($order->info['shipping_method'])) {
$submit_data["items[" . $i . "][description]"] = $order->info['shipping_method'];
$submit_data["items[" . $i . "][quantity]"] = 1;
$submit_data["items[" . $i . "][amount]"] = number_format($order->info['shipping_cost'], 2, '.', '');
$desciption[] = $order->info['shipping_method'];
$i++;
}
foreach ($order->products as $product) {
$submit_data["items[" . $i . "][description]"] = $product['name'] . " (" . $product['qty'] . ") ";
$submit_data["items[" . $i . "][quantity]"] = $product['qty'];
$submit_data["items[" . $i . "][amount]"] = number_format($product['final_price'] * $product['qty'], 2, '.', '');
$desciption[] = $product['name'] . " ( " . $product['qty'] . " )";
$i++;
}
$submit_data['description'] = implode(",", $desciption);
$this->notify('NOTIFY_PAYMENT_AUTHNETSIM_PRESUBMIT_HOOK');
if (MODULE_PAYMENT_PAGAMASTARDE_TESTMODE == 'Test') {
$submit_data['x_Test_Request'] = 'TRUE';
}
$submit_data[zen_session_name()] = zen_session_id();
$process_button_string = "\n";
foreach ($submit_data as $key => $value) {
$process_button_string .= zen_draw_hidden_field($key, $value) . "\n";
}
return $process_button_string;
}
开发者ID:pagantis,项目名称:pagamastarde-zencart,代码行数:87,代码来源:pagamastarde.php
示例16: zen_session_start
function zen_session_start()
{
@ini_set('session.gc_probability', 1);
@ini_set('session.gc_divisor', 2);
if (IS_ADMIN_FLAG === true) {
@ini_set('session.gc_maxlifetime', SESSION_TIMEOUT_ADMIN > 900 ? 900 : SESSION_TIMEOUT_ADMIN);
} elseif (defined('SESSION_TIMEOUT_CATALOG') && (int) SESSION_TIMEOUT_CATALOG > 120) {
@ini_set('session.gc_maxlifetime', (int) SESSION_TIMEOUT_CATALOG);
}
if (preg_replace('/[a-zA-Z0-9]/', '', session_id()) != '') {
zen_session_id(md5(uniqid(rand(), true)));
}
$temp = session_start();
if (!isset($_SESSION['securityToken'])) {
$_SESSION['securityToken'] = md5(uniqid(rand(), true));
}
return $temp;
}
开发者ID:kirkbauer2,项目名称:kirkzc,代码行数:18,代码来源:sessions.php
示例17: add_sid
/**
* Adds the sid to the end of the URL if needed. If a page cache has been
* enabled and no customer is logged in the sid is replaced with '<zinsid>'.
*
* @param string $link current URL.
* @param bool $add_session_id true if a session id be added to the url, false otherwise
* @param string $connection 'NONSSL' or 'SSL' the type of connection to use
* @param string $separator the separator to use between the link and this paramater (if added)
* @return unknown
*/
function add_sid($link, $add_session_id, $connection, $separator)
{
global $request_type, $http_d
|
请发表评论