function execute() { global $PHP_SELF, $currencies, $request_type, $currency, $oscTemplate; if (substr(basename($PHP_SELF), 0, 8) != 'checkout') { if (isset($currencies) && is_object($currencies) && count($currencies->currencies) > 1) { reset($currencies->currencies); $currencies_array = array(); while (list($key, $value) = each($currencies->currencies)) { $currencies_array[] = array('id' => $key, 'text' => $value['title']); } $hidden_get_variables = ''; reset($_GET); while (list($key, $value) = each($_GET)) { if (is_string($value) && $key != 'currency' && $key != tep_session_name() && $key != 'x' && $key != 'y') { $hidden_get_variables .= tep_draw_hidden_field($key, $value); } } $form_output = tep_draw_form('currencies', tep_href_link($PHP_SELF, '', $request_type, false), 'get') . tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onchange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id() . '</form>'; ob_start(); include 'includes/modules/boxes/templates/currencies.php'; $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } } }
function b_shop_currencies() { global $currencies, $currencies, $currency, $xoopsConfig, $HTTP_GET_VARS, $PHP_SELF, $languages_id; if (isset($_GET['currency'])) { $_SESSION['currency'] = $_GET['currency']; } $currency = isset($_GET['currency']) ? $_GET['currency'] : $_SESSION['currency']; $block = array(); $block['title'] = BOX_HEADING_CURRENCIES; $block['datum'] = "2003-04-03"; if (!isset($currencies) || !is_object($currencies)) { $currencies = new currencies(); } $block['content'] = "<form name=\"currencies\" action=\"{$PHP_SELF}\" method=\"GET\">"; $block['content'] .= "<select name=\"currency\" onChange=\"this.form.submit();\">"; reset($currencies->currencies); $currencies_array = array(); while (list($key, $value) = each($currencies->currencies)) { $block['content'] .= "<option value=\"{$key}\""; if ($key == $currency) { $block['content'] .= " selected"; } $block['content'] .= ">" . $value['title'] . "</option>"; } $block['content'] .= "</select>"; reset($HTTP_GET_VARS); while (list($key, $value) = each($HTTP_GET_VARS)) { if ($key != 'currency' && $key != tep_session_name() && $key != 'x' && $key != 'y') { $block['content'] .= "<input type=\"hidden\" name=\"{$key}\" value=\"{$value}\">"; } } $block['content'] .= "</form>"; return $block; }
function get_admin_link($page = '', $parameters = '', $add_session_id = true) { global $request_type, $session_started, $SID; if (!tep_not_null($page)) { $page = PAGE_DEFAULT; } $link = _HTTP_ADMIN_SITE_ROOT . '/?'; if (tep_not_null($parameters)) { $link .= $page . '&' . tep_output_string($parameters); $separator = '&'; } else { $link .= $page; $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 && SESSION_FORCE_COOKIE_USE == 'False') { if (tep_not_null($SID)) { $_sid = $SID; } elseif ($request_type == 'NONSSL' && $connection == 'SSL' && ENABLE_SSL == true || $request_type == 'SSL' && $connection == 'NONSSL') { if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) { $_sid = tep_session_name() . '=' . tep_session_id(); } } } if (isset($_sid)) { $link .= $separator . tep_output_string($_sid); } return $link; }
function execute() { global $PHP_SELF, $lng, $request_type, $oscTemplate, $language, $request_type, $HTTP_GET_VARS, $current_lang_key; if (substr(basename($PHP_SELF), 0, 8) != 'checkout') { if (!isset($lng) || isset($lng) && !is_object($lng)) { include DIR_WS_CLASSES . 'language.php'; $lng = new language(); } if (count($lng->catalog_languages) > 1) { reset($lng->catalog_languages); $languages_array = array(); while (list($key, $value) = each($lng->catalog_languages)) { $languages_array[] = array('id' => $key, 'text' => $value['name']); } foreach ($lng->catalog_languages as $key => $value) { if ($value['directory'] == $language) { $current_lang_key = $key; break; } } reset($HTTP_GET_VARS); while (list($key, $value) = each($HTTP_GET_VARS)) { if (is_string($value) && $key != 'language' && $key != tep_session_name() && $key != 'x' && $key != 'y') { $hidden_get_variables .= tep_draw_hidden_field($key, $value); } } $data = '<div class="headerBox languages">' . ' <span class="headerTitle languages-title">' . MODULE_BOXES_HEADER_LANGUAGES_BOX_TITLE . '</span>' . ' <div class="headerBoxContents">' . ' ' . tep_draw_form('languages', tep_href_link($PHP_SELF, '', $request_type, false), 'get') . ' ' . tep_draw_pull_down_menu('language', $languages_array, $current_lang_key, 'onchange="this.form.submit();"') . $hidden_get_variables . tep_hide_session_id() . '</form>' . ' </div>' . '</div>'; $oscTemplate->addBlock($data, $this->group); } } }
function tep_session_start() { global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS; $sane_session_id = true; 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(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false)); } return session_start(); }
function osc_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) { if (!tep_not_null($page)) { 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>'); } if ($connection == 'NONSSL') { $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG; } elseif ($connection == 'SSL') { if (ENABLE_SSL == true) { $link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG; } else { $link = HTTP_SERVER . DIR_WS_HTTP_CATALOG; } } 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</b><br><br>'); } if (tep_not_null($parameters)) { $link .= $page . '?' . tep_output_string($parameters); $separator = '&'; } else { $link .= $page; $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 && usu::$session_started == true && SESSION_FORCE_COOKIE_USE == 'False') { if (tep_not_null(usu::$sid)) { $_sid = usu::$sid; } elseif (usu::$request_type == 'NONSSL' && $connection == 'SSL' && ENABLE_SSL == true || usu::$request_type == 'SSL' && $connection == 'NONSSL') { if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) { $_sid = tep_session_name() . '=' . tep_session_id(); } } } //commented out SEARCH_ENGINE_FRIENDLY_URLS since removed from oscmax 2.1 sql file /* if ( ( SEARCH_ENGINE_FRIENDLY_URLS == 'true' ) && ( $search_engine_safe == true ) ) { while ( strstr( $link, '&&' ) ) $link = str_replace( '&&', '&', $link ); $link = str_replace( '?', '/', $link ); $link = str_replace( '&', '/', $link ); $link = str_replace( '=', '/', $link ); $separator = '?'; } */ if (isset($_sid)) { $link .= $separator . tep_output_string($_sid); } usu::$performance['std_url_array'][] = $link; if (defined('SEO_URLS_USE_W3C_VALID') && SEO_URLS_USE_W3C_VALID == 'true') { return htmlspecialchars(utf8_encode($link)); } return $link; }
function tep_doautologin() { global $HTTP_COOKIE_VARS, $cart, $cart_cs, $cart_fv, $cart_pr, $customer_id, $customer_default_address_id, $customer_first_name, $customer_country_id, $customer_zone_id; global $navigation; if (isset($HTTP_COOKIE_VARS['osC_AutoCookieLogin'])) { $ip_address = tep_get_ip_address(); $check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where md5(CONCAT(customers_id,customers_email_address,customers_password,'" . $ip_address . "'))= '" . $HTTP_COOKIE_VARS['osC_AutoCookieLogin'] . "'"); if (tep_db_num_rows($check_customer_query)) { $check_customer = tep_db_fetch_array($check_customer_query); if (SESSION_RECREATE == 'True') { tep_session_recreate(); } $check_country_query = tep_db_query("select entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $check_customer['customers_id'] . "' and address_book_id = '" . (int) $check_customer['customers_default_address_id'] . "'"); $check_country = tep_db_fetch_array($check_country_query); $customer_id = $check_customer['customers_id']; $customer_default_address_id = $check_customer['customers_default_address_id']; $customer_first_name = $check_customer['customers_firstname']; $customer_country_id = $check_country['entry_country_id']; $customer_zone_id = $check_country['entry_zone_id']; if (!tep_session_is_registered('customer_id')) { tep_session_register('customer_id'); } if (!tep_session_is_registered('customer_default_address_id')) { tep_session_register('customer_default_address_id'); } if (!tep_session_is_registered('customer_first_name')) { tep_session_register('customer_first_name'); } if (!tep_session_is_registered('customer_country_id')) { tep_session_register('customer_country_id'); } if (!tep_session_is_registered('customer_zone_id')) { tep_session_register('customer_zone_id'); } tep_autologincookie(true); // Save cookie tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1 where customers_info_id = '" . (int) $customer_id . "'"); $cart->restore_contents(); // restore cart contents $cart_cs->restore_contents(); $cart_fv->restore_contents(); $cart_pr->restore_contents(); if (sizeof($navigation->snapshot) > 0) { $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']); $navigation->clear_snapshot(); tep_redirect($origin_href); } else { // tep_redirect(tep_href_link(FILENAME_DEFAULT)); tep_redirect(substr(tep_href_link(getenv('REQUEST_URI')), strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG))); } } } }
function display_links($query_numrows, $max_rows_per_page, $max_page_links, $current_page_number, $parameters = '', $page_name = 'page') { global $PHP_SELF; if (tep_not_null($parameters) && substr($parameters, -1) != '&') { $parameters .= '&'; } // calculate number of pages needing links $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 = tep_draw_form('pages', basename($PHP_SELF), '', 'get'); if ($current_page_number > 1) { $display_links .= '<a href="' . tep_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, tep_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="' . tep_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 .= tep_draw_hidden_field(rawurldecode($key), rawurldecode($value)); } } if (SID) { $display_links .= tep_draw_hidden_field(tep_session_name(), tep_session_id()); } $display_links .= '</form>'; } else { $display_links = sprintf(TEXT_RESULT_PAGE, $num_pages, $num_pages); } return $display_links; }
function process() { global $order, $cart, $buysafe_result, $currencies, $WantsBond, $PHP_SELF; if (is_array($buysafe_result) && $buysafe_result['IsBuySafeEnabled'] == 'true') { $WantsBond = $buysafe_result['BondCostDisplayText'] != '' ? true : false; if (strstr($PHP_SELF, FILENAME_CHECKOUT_CONFIRMATION)) { $hidden_fields = ''; if (is_array($_POST) && sizeof($_POST) > 0) { reset($_POST); while (list($key, $value) = each($_POST)) { if (strlen($value) > 0 && $key != tep_session_name() && $key != 'WantsBond' && $key != 'x' && $key != 'y') { $hidden_fields .= tep_draw_hidden_field($key, stripslashes($value)); } } } $regs = array(); preg_match_all("'<BondingSignal[^>]*?>.*?</BondingSignal>'", $_SESSION['nusoap_response'], $regs); $rollover = end($regs[0]); $rollover = strip_tags(substr($rollover, strpos($rollover, '>') + 1)); $rollover = html_entity_decode($rollover); $output_title = tep_draw_form('buysafe_confirmation', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post') . tep_draw_hidden_field('WantsBond', $WantsBond ? $WantsBond : 'false') . $hidden_fields . ' <script src="' . MODULE_ADDONS_BUYSAFE_ROLLOVER_URL . '" type="text/javascript" language="javascript" charset="utf-8"></script> <script language="JavaScript" type="text/javascript"> <!-- function buySAFEOnClick() { if (document.buysafe_confirmation.WantsBond.value == \'false\') { document.buysafe_confirmation.WantsBond.value = \'true\'; } else { document.buysafe_confirmation.WantsBond.value = \'false\'; } document.buysafe_confirmation.submit(); } //--> </script>' . $rollover . '</form>'; } else { $output_title = $buysafe_result['CartLineDisplayText']; } $this->output[] = array('title' => $output_title, 'text' => $buysafe_result['BondCostDisplayText'], 'value' => $buysafe_result['BondCostDisplayText'] ? $buysafe_result['TotalBondCost'] : 0); if ($buysafe_result['BondCostDisplayText'] && $buysafe_result['TotalBondCost']) { $order->info['total'] += $buysafe_result['TotalBondCost']; } } // end if (is_array($buysafe_result)) }
function execute() { global $PHP_SELF, $currencies, $HTTP_GET_VARS, $request_type, $currency, $oscTemplate; if (substr(basename($PHP_SELF), 0, 8) != 'checkout') { if (isset($currencies) && is_object($currencies) && count($currencies->currencies) > 1) { reset($currencies->currencies); $currencies_array = array(); while (list($key, $value) = each($currencies->currencies)) { $currencies_array[] = array('id' => $key, 'text' => $value['title']); } $hidden_get_variables = ''; reset($HTTP_GET_VARS); while (list($key, $value) = each($HTTP_GET_VARS)) { if (is_string($value) && $key != 'currency' && $key != tep_session_name() && $key != 'x' && $key != 'y') { $hidden_get_variables .= tep_draw_hidden_field($key, $value); } } $data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_CURRENCIES_BOX_TITLE . '</div>' . ' <div class="ui-widget-content infoBoxContents">' . ' ' . tep_draw_form('currencies', tep_href_link($PHP_SELF, '', $request_type, false), 'get') . ' ' . tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onchange="this.form.submit();" style="width: 100%"') . $hidden_get_variables . tep_hide_session_id() . '</form>' . ' </div>' . '</div>'; $oscTemplate->addBlock($data, $this->group); } } }
} $auth->login($get_forum_username['username_clean'], $_POST['password'], $remember, 1, 0); } /*FORUM*/ // navigation history $extra_link_data = ''; if (isset($_GET['language'])) { $extra_link_data = 'language=' . $_GET['language']; } if (sizeof($navigation->snapshot) > 0 && !strstr($navigation->snapshot['page'], 'login.php')) { $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())) . '&' . $extra_link_data, $navigation->snapshot['mode']); tep_redirect($origin_href); } else { if (sizeof($navigation->path) > 0 && !strstr($navigation->path[$last]['page'], 'login.php')) { $last = sizeof($navigation->path) - 1; $origin_href = tep_href_link($navigation->path[$last]['page'], tep_array_to_string($navigation->path[$last]['get'], array(tep_session_name())) . '&' . $extra_link_data, $navigation->path[$last]['mode']); tep_redirect($origin_href); } else { if (strstr($_SERVER['HTTP_REFERER'], 'logoff.php')) { tep_redirect(tep_href_link(FILENAME_DEFAULT, $extra_link_data)); } else { tep_redirect(tep_href_link(FILENAME_DEFAULT, $extra_link_data)); } } } } } } } if ($error == true) { $messageStack->add('login', Translate('Fout: er kon niet ingelogd worden met het ingegeven e-mailadres en wachtwoord. Gelieve opnieuw te proberen'));
line-height: 1.5; } </style> <p class="pageHeading"><?php echo STORE_NAME; ?> </p> <p class="main" align="center"><?php echo MODULE_PAYMENT_WORLDPAY_JUNIOR_TEXT_SUCCESSFUL_TRANSACTION; ?> </p> <p align="center"><input type="button" value="<?php echo sprintf(MODULE_PAYMENT_WORLDPAY_JUNIOR_TEXT_CONTINUE_BUTTON, addslashes(STORE_NAME)); ?> " onclick="document.location.href='<?php echo tep_href_link(FILENAME_CHECKOUT_PROCESS, tep_session_name() . '=' . $HTTP_POST_VARS['M_sid'] . '&hash=' . $HTTP_POST_VARS['hash'], 'SSL', false); ?> ';"></p> <p> </p> <WPDISPLAY ITEM=banner> <?php } } } } }
mkdir($categories_cache_dir, 0777); } $categories_cache_dir .= $products_types['products_types_id'] . '/'; if (!is_dir($categories_cache_dir)) { mkdir($categories_cache_dir, 0777); } $categories_cache_filename = $categories_cache_dir . 'tree_0.html'; $include_categories_cache_filename = false; if (file_exists($categories_cache_filename)) { if (date('Y-m-d H:i:s', filemtime($categories_cache_filename)) > $products_types['products_last_modified']) { $include_categories_cache_filename = true; } } if ($include_categories_cache_filename == false) { $categories_string = tep_show_category(0, 1, '', $products_types['products_types_id'], true); $categories_string = str_replace('?' . tep_session_name() . '=' . tep_session_id(), '', $categories_string); $fp = fopen($categories_cache_filename, 'w'); fwrite($fp, $categories_string); fclose($fp); } else { $categories_string = ''; $fp = fopen($categories_cache_filename, 'r'); while (!feof($fp)) { $categories_string .= fgets($fp, 400); } fclose($fp); } if ($products_types['products_types_default_status'] == '0') { echo ' <div class="li"><div class="level_1"><a href="' . tep_href_link(FILENAME_CATEGORIES, 'tPath=' . $products_types['products_types_id'] . '&view=all') . '" class="active">' . TEXT_ALL_CATEGORY_PRODUCTS . '</a></div></div>' . "\n"; } elseif ($products_types['products_types_default_status'] == '1') { $specials_types_query = tep_db_query("select specials_types_id, specials_types_path, specials_types_name from " . TABLE_SPECIALS_TYPES . " where specials_types_id in ('" . implode("', '", $active_specials_types_array) . "') and language_id = '" . (int) DEFAULT_LANGUAGE_ID . "' order by sort_order, specials_types_name limit 4");
tep_redirect($_SERVER['HTTP_REFERER']); } } elseif (!tep_session_is_registered('enable_ssl')) { if ($request_type == 'SSL') { $enable_ssl = 'on'; tep_session_register('enable_ssl'); } elseif (isset($HTTP_GET_VARS['ssl']) && ($HTTP_GET_VARS['ssl'] == 'on' || $HTTP_GET_VARS['ssl'] == 'off')) { $enable_ssl = $HTTP_GET_VARS['ssl']; if (!tep_session_is_registered('enable_ssl')) { tep_session_register('enable_ssl'); } if (strpos($_SERVER['HTTP_REFERER'], str_replace('http://', '', HTTP_SERVER)) !== false) { tep_redirect($_SERVER['HTTP_REFERER']); } } else { $session_name = tep_session_name(); $session_id = tep_session_id(); $link = REQUEST_URI; if (strpos($link, $session_name) === false) { if (strpos($link, '?') !== false) { $link .= '&' . $session_name . '=' . $session_id; } else { $link .= '?' . $session_name . '=' . $session_id; } } if (strpos($link, '?') !== false) { $link .= '&ssl=ssl_value'; } else { $link .= '?ssl=ssl_value'; } $javascript = 'ssl_check.js.php';
function tep_hide_session_id() { global $session_started, $SID; if ($session_started == true && tep_not_null($SID)) { return tep_draw_hidden_field(tep_session_name(), tep_session_id()); } }
function before_process() { global $HTTP_POST_VARS; if ($HTTP_POST_VARS['valid'] == 'true') { if ($remote_host = getenv('REMOTE_HOST')) { if ($remote_host != 'secpay.com') { $remote_host = gethostbyaddr($remote_host); } if ($remote_host != 'secpay.com') { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, tep_session_name() . '=' . $HTTP_POST_VARS[tep_session_name()] . '&payment_error=' . $this->code, 'SSL', false, false)); } } else { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, tep_session_name() . '=' . $HTTP_POST_VARS[tep_session_name()] . '&payment_error=' . $this->code, 'SSL', false, false)); } } }
function tep_get_params($exclude_array = '') { global $_GET; if (!is_array($exclude_array)) { $exclude_array = array(); } $get_url = ''; if (is_array($_GET) && sizeof($_GET) > 0) { reset($_GET); while (list($key, $value) = each($_GET)) { if (strlen($value) > 0 && $key != tep_session_name() && $key != 'error' && !in_array($key, $exclude_array) && $key != 'x' && $key != 'y') { $get_url .= $key . '=' . rawurlencode(stripslashes($value)) . '&'; } } } return $get_url; }
tep_session_name('osCsid'); tep_session_save_path(SESSION_WRITE_DIRECTORY); // set the session cookie parameters if (function_exists('session_set_cookie_params')) { session_set_cookie_params(0, $cookie_path, $cookie_domain); } elseif (function_exists('ini_set')) { ini_set('session.cookie_lifetime', '0'); ini_set('session.cookie_path', $cookie_path); ini_set('session.cookie_domain', $cookie_domain); } @ini_set('session.use_only_cookies', SESSION_FORCE_COOKIE_USE == 'True' ? 1 : 0); // set the session ID if it exists if (isset($HTTP_POST_VARS[tep_session_name()])) { tep_session_id($HTTP_POST_VARS[tep_session_name()]); } elseif ($request_type == 'SSL' && isset($HTTP_GET_VARS[tep_session_name()])) { tep_session_id($HTTP_GET_VARS[tep_session_name()]); } // start the session $session_started = false; if (SESSION_FORCE_COOKIE_USE == 'True') { tep_setcookie('cookie_test', 'please_accept_for_session', time() + 60 * 60 * 24 * 30, $cookie_path, $cookie_domain); if (isset($HTTP_COOKIE_VARS['cookie_test'])) { tep_session_start(); $session_started = true; } } elseif (SESSION_BLOCK_SPIDERS == 'True') { $user_agent = strtolower(getenv('HTTP_USER_AGENT')); $spider_flag = false; if (tep_not_null($user_agent)) { $spiders = file(DIR_WS_INCLUDES . 'spiders.txt'); for ($i = 0, $n = sizeof($spiders); $i < $n; $i++) {
define($configuration['cfgKey'], $configuration['cfgValue']); } // define our general functions used application-wide require DIR_WS_FUNCTIONS . 'general.php'; require DIR_WS_FUNCTIONS . 'html_output.php'; // initialize the logger class require DIR_WS_CLASSES . 'logger.php'; // include shopping cart class require DIR_WS_CLASSES . 'shopping_cart.php'; // define how the session functions will be used require DIR_WS_FUNCTIONS . 'sessions.php'; // set the cookie domain $cookie_domain = $request_type == 'NONSSL' ? HTTP_COOKIE_DOMAIN : HTTPS_COOKIE_DOMAIN; $cookie_path = $request_type == 'NONSSL' ? HTTP_COOKIE_PATH : HTTPS_COOKIE_PATH; // set the session name and save path tep_session_name('osCAdminID'); tep_session_save_path(SESSION_WRITE_DIRECTORY); // set the session cookie parameters if (function_exists('session_set_cookie_params')) { session_set_cookie_params(0, $cookie_path, $cookie_domain); } elseif (function_exists('ini_set')) { ini_set('session.cookie_lifetime', '0'); ini_set('session.cookie_path', $cookie_path); ini_set('session.cookie_domain', $cookie_domain); } @ini_set('session.use_only_cookies', SESSION_FORCE_COOKIE_USE == 'True' ? 1 : 0); // lets start our session tep_session_start(); if (PHP_VERSION >= 4.3 && function_exists('ini_get') && ini_get('register_globals') == false) { extract($_SESSION, EXTR_OVERWRITE + EXTR_REFS); }
function process_button($transactionID = 0, $key = "") { // Change made by using PlugnPay API Connection $card_cvv=$_POST['cvv']; $process_button_string = tep_draw_hidden_field('credit_card_type', $_POST['credit_card_type']) . tep_draw_hidden_field('card_owner', $_POST['plugnpay_cc_owner']) . tep_draw_hidden_field('card_cvv', $_POST['cvv']) . tep_draw_hidden_field('transactionID', $transactionID) . tep_draw_hidden_field('key', $key) . tep_draw_hidden_field('sess_id', tep_session_id()) . tep_draw_hidden_field('card_number', $this->cc_card_number) . tep_draw_hidden_field('card_exp', $this->cc_expiry_month . substr($this->cc_expiry_year, -2)); $process_button_string .= tep_draw_hidden_field(tep_session_name(), tep_session_id()); return $process_button_string; }
function tep_session_recreate() { if (PHP_VERSION >= 4.1) { $session_backup = $_SESSION; unset($_COOKIE[tep_session_name()]); tep_session_destroy(); if (STORE_SESSIONS == 'mysql') { session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc'); } tep_session_start(); $_SESSION = $session_backup; unset($session_backup); } }
echo BOX_HEADING_CURRENCIES; ?> </div> <form role="form" class="form-inline no-margin-bottom" name="currencies" action="<?php echo tep_href_link(basename($PHP_SELF), '', $request_type, false); ?> " method="get"> <?php while (list($key, $value) = each($currencies->currencies)) { $currencies_array[] = array('id' => $key, 'text' => $value['title']); } $hidden_get_variables = ''; reset($_GET); while (list($key, $value) = each($_GET)) { if ($key != 'currency' && $key != tep_session_name() && $key != 'x' && $key != 'y') { $hidden_get_variables .= tep_draw_hidden_field($key, $value); } } echo '<ul class="box-information_pages-ul list-unstyled list-indent-large"><li>' . tep_draw_pull_down_menu('currency', $currencies_array, $currency, 'onChange="this.form.submit();" class="box-manufacturers-select form-control form-input-width style="width: 80%"') . $hidden_get_variables . tep_hide_session_id() . '<li></ul>'; ?> </form> </div> <tr> <td> </td> </tr>
function debug() { for ($i = 0, $n = sizeof($this->path); $i < $n; $i++) { echo $this->path[$i]['page'] . '?'; while (list($key, $value) = each($this->path[$i]['get'])) { echo $key . '=' . $value . '&'; } if (sizeof($this->path[$i]['post']) > 0) { echo '<br />'; while (list($key, $value) = each($this->path[$i]['post'])) { echo ' <strong>' . $key . '=' . $value . '</strong><br />'; } } echo '<br />'; } if (sizeof($this->snapshot) > 0) { echo '<br /><br />'; echo $this->snapshot['mode'] . ' ' . $this->snapshot['page'] . '?' . tep_array_to_string($this->snapshot['get'], array(tep_session_name())) . '<br />'; } }
// include shopping cart class require DIR_WS_CLASSES . 'shopping_cart.php'; // define how the session functions will be used require DIR_WS_FUNCTIONS . 'sessions.php'; // set the session name and save path tep_session_name('osCAdminID'); tep_session_save_path(SESSION_WRITE_DIRECTORY); // set the session cookie parameters if (function_exists('session_set_cookie_params')) { session_set_cookie_params(0, DIR_WS_ADMIN); } elseif (function_exists('ini_set')) { ini_set('session.cookie_lifetime', '0'); ini_set('session.cookie_path', DIR_WS_ADMIN); } if (isset($_POST) && array_key_exists(tep_session_name(), $_POST)) { tep_session_id($_POST[tep_session_name()]); } // lets start our session tep_session_start(); if (!tep_session_is_registered('login_id')) { if (empty($_POST) && empty($_GET)) { tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } else { echo ' <script> document.location=\'' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '\'; </script>'; die; } } chdir('includes/javascript/ckeditor/filemanager/');
function tep_get_all_get_params($exclude_array = '') { global $HTTP_GET_VARS; if (!is_array($exclude_array)) { if (!empty($exclude_array)) { $exclude_array = array($exclude_array); } else { $exclude_array = array(); } } $get_url = ''; if (is_array($HTTP_GET_VARS) && sizeof($HTTP_GET_VARS) > 0) { reset($HTTP_GET_VARS); while (list($key, $value) = each($HTTP_GET_VARS)) { if (strlen($value) > 0 && $key != tep_session_name() && $key != 'error' && !in_array($key, $exclude_array) && $key != 'x' && $key != 'y') { $get_url .= print_var($key, $value); } } } return $get_url; }
?> </td> <td class="dataTableContent" align="center"><?php echo $whos_online['ip_address']; ?> </td> <td class="dataTableContent"><?php echo date('H:i:s', $whos_online['time_entry']); ?> </td> <td class="dataTableContent" align="center"><?php echo date('H:i:s', $whos_online['time_last_click']); ?> </td> <td class="dataTableContent"><?php if (eregi('^(.*)' . tep_session_name() . '=[a-f,0-9]+[&]*(.*)', $whos_online['last_page_url'], $array)) { echo $array[1] . $array[2]; } else { echo $whos_online['last_page_url']; } ?> </td> </tr> <?php } ?> <tr> <td class="smallText" colspan="7"><?php echo sprintf(TEXT_NUMBER_OF_CUSTOMERS, tep_db_num_rows($whos_online_query)); ?> </td>
$mss_flag = false; if ($user_info['verification_status'] == 1 && $current_ip != $user_info['verification_ip']) { $mss_flag = true; } if ($mss_flag) { $verification_key = tep_create_random_value(10, 'digits'); $signup_data_array['verification_key'] = $verification_key; db_perform(_TABLE_USERS, $signup_data_array, 'update', " user_id='" . $user_info['user_id'] . "' "); $email_info = get_email_template('VERIFYCATION_KEY'); $msg_subject = $email_info['emailtemplate_subject']; $msg_content = str_replace(array('[firstname]', '[verification_key]'), array($user_info['firstname'], $verification_key), $email_info['emailtemplate_content']); $msg_content = html_entity_decode($msg_content); tep_mail($user_info['firstname'] . ' ' . $user_info['lastname'], $user_info['email'], $msg_subject, $msg_content, SITE_NAME, SITE_CONTACT_EMAIL); } if (sizeof($navigation->snapshot) > 0) { $origin_href = get_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']); $navigation->clear_snapshot(); tep_redirect($origin_href, '', 'SSL'); } else { tep_redirect(get_href_link(PAGE_LOGIN_CONFIRM, '', 'SSL')); } } } else { $validator->addError(ERROR_FIELD_LOGIN, ERROR_INVALID_ACCOUNT); } if (count($validator->errors) == 0) { // create new user } else { postAssign($smarty); $smarty->assign('validerrors', $validator->errors); }
mkdir($categories_cache_dir, 0777); } $categories_cache_filename = $categories_cache_dir . 'tree_' . $current_category_id . '.html'; $include_categories_cache_filename = false; if (file_exists($categories_cache_filename)) { if (date('Y-m-d H:i:s', filemtime($categories_cache_filename)) > $type_info['products_last_modified']) { $include_categories_cache_filename = true; } } $box_info_query = tep_db_query("select blocks_name from " . TABLE_BLOCKS . " where blocks_filename = '" . tep_db_input(basename(__FILE__)) . "' and language_id = '" . (int) $languages_id . "'"); $box_info = tep_db_fetch_array($box_info_query); $boxHeading = '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'tPath=' . $check_products_types_id) . '">' . $box_info['blocks_name'] . '</a>'; $boxID = $type_info['products_types_path']; if ($include_categories_cache_filename == false) { $boxContent = tep_show_category(0, 0, '', $check_products_types_id); $boxContent = str_replace('?' . tep_session_name() . '=' . tep_session_id(), '', $boxContent); $fp = fopen($categories_cache_filename, 'w'); fwrite($fp, $boxContent); fclose($fp); } else { $boxContent = ''; $fp = fopen($categories_cache_filename, 'r'); while (!feof($fp)) { $boxContent .= fgets($fp, 400); } fclose($fp); } if (tep_not_null($boxContent)) { include DIR_WS_TEMPLATES_BOXES . 'box.php'; } }
function tep_get_all_get_params($exclude_array = '') { global $HTTP_GET_VARS; if ($exclude_array == '') { $exclude_array = array(); } $get_url = ''; reset($HTTP_GET_VARS); while (list($key, $value) = each($HTTP_GET_VARS)) { if ($key != tep_session_name() && $key != 'error' && !in_array($key, $exclude_array)) { $get_url .= $key . '=' . $value . '&'; } } return $get_url; }
function tep_session_recreate() { global $SID; if (PHP_VERSION >= 5.1) { session_regenerate_id(true); if (!empty($SID)) { $SID = tep_session_name() . '=' . tep_session_id(); } } }