* Create the singleton objects. */ $svm = Caching_SessionVarManager::get_instance(); $page_manager = PublicHTML_PageManager::get_instance(); $log_in_manager = Shop_LogInManager::get_instance(); /* * If the user wants to create an account. */ if (isset($_GET['create_new_account'])) { /* * Check that we know where to go if something has gone * wrong. */ $form_location = new HTMLTags_URL(); if (isset($_GET['form_location'])) { $form_location->parse_url($_GET['form_location']); } elseif (isset($_SERVER['HTTP_REFERER'])) { $form_location->parse_url($_SERVER['HTTP_REFERER']); } else { throw new Exception('Unable to set the form URL!'); } /* * Set the session vars. */ if (isset($_POST['email'])) { $svm->set('create-new-account: email', $_POST['email']); } if (isset($_POST['confirm_email'])) { $svm->set('create-new-account: confirm_email', $_POST['confirm_email']); } try {
<?php /** * The default pre-main section for redirect-scripts. * * @copyright Clear Line Web Design, 2007-07-17 */ //echo '__FILE__: ' . __FILE__ . "\n"; //exit; /* * Create the singleton objects. */ $gvm = Caching_GlobalVarManager::get_instance(); $page_manager = PublicHTML_PageManager::get_instance(); /* * This is the old fashioned way of doing this. */ if (isset($_GET['return_to'])) { $return_to = new HTMLTags_URL(); $return_to->parse_url($_GET['return_to']); $page_manager->set_return_to_url($return_to); } else { #$return_to_url = $page_manager->get_return_to_url(); $rm = new PublicHTML_RedirectionManager(); $return_to_url = $rm->get_current_url(); $return_to_url->set_get_variable('type', 'html'); $page_manager->set_return_to_url($return_to_url); } /* * See check-get-vars.inc.php for the newer way. */
$shopping_baskets_table->delete_illegal_shopping_baskets_for_current_customer_region(); $shopping_baskets_table->convert_shopping_baskets_for_current_session_to_new_customer_region(); } if ($log_in_manager->is_logged_in()) { $user = $log_in_manager->get_user(); if ($user->get_customer_region_id() != 0) { $user->set_customer_region_id($_SESSION['customer_region_id']); } $svm = Caching_SessionVarManager::get_instance(); $svm->set('customer_shipping_details_confirmed', FALSE); } } elseif (isset($_SESSION['customer_region_id'])) { // echo "customer_region_id set in the session variable.\n"; } else { // echo "customer_region_id has not been set by GET or in the session, getting the default from the DB.\n"; $default_customer_region = $customer_regions_table->get_default_customer_region(); // echo '$default_customer_region->get_id()' . ": \n"; // echo $default_customer_region->get_id() . "\n"; $_SESSION['customer_region_id'] = $default_customer_region->get_id(); } /* * Set the return location after successfully adding to the database. */ $return_to_url = new HTMLTags_URL(); if (isset($_GET['desired_location'])) { $return_to_url->parse_url(urldecode($_GET['desired_location'])); $return_to_url->set_get_variable('customer_region_session', $_SESSION['customer_region_id']); } else { $return_to_url->set_file('/'); } $page_manager->set_return_to_url($return_to_url);
///* // * Define which page we are on. // */ //define('PAGE', isset($_GET['page']) ? $_GET['page'] : 'home'); $success_url = new HTMLTags_URL(); if (isset($_GET['success_url'])) { $success_url->parse_url($_GET['success_url']); } else { if (isset($_GET['return_to'])) { $success_url->parse_url($_GET['return_to']); } else { $rm = new PublicHTML_RedirectionManager(); $success_url = $rm->get_current_url(); $success_url->set_get_variable('type', 'html'); } } $gvm->set('success-url', $success_url); $failure_url = new HTMLTags_URL(); if (isset($_GET['failure_url'])) { $failure_url->parse_url($_GET['failure_url']); } else { if (isset($_GET['return_to'])) { $success_url->parse_url($_GET['return_to']); } else { $failure_url = clone $success_url; } } $gvm->set('failure-url', $failure_url); #echo 'print_r($gvm): ' . "\n"; #print_r($gvm); #exit;