Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Check if a user can start the winter mooring buying process and setup session
- *
- * Long desc
- *
- * @package BwMoorings
- * @subpackage WinterMoorings
- * @author Paul Morgan <[email protected]>
- * @version $Id: tags.version.pkg
- */
- /**
- *
- */
- session_start();
- include_once(ETC_DIR . 'preload_options.php');
- CheckAccess($_SESSION['bwm_user_reg'], 1);
- if (isset($_SESSION['wintermooring'])) {
- unset($_SESSION['wintermooring']);
- }
- $_SESSION['winter_mooring'] = array();
- if (filter_has_var(INPUT_GET, "id")) {
- $mlid = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
- //check id is in the form expected and exists in the database.
- if (filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT)) {
- $_SESSION['wintermooring']['id'] = $mlid;
- }
- } else {
- // set error and then log the problem?
- $_SESSION['errors'] = array('bad_id','The mooring location cannot be found on our database. Please search again.');
- header("Location: " . BWSITEURL . "winter-mooring/error.php");
- exit;
- }
- if (filter_has_var(INPUT_GET, "type")) {
- $mltype = filter_input(INPUT_GET, 'type', FILTER_SANITIZE_STRING);
- if (in_array($mltype, array('mooring') )) {
- $_SESSION['wintermooring']['type'] = $mltype;
- }
- } else {
- // set error and then log the problem?
- $_SESSION['errors'] = array('bad_id','The mooring location cannot be found on our database. Please search again.');
- header("Location: " . BWSITEURL . "winter-mooring/error.php");
- exit;
- }
- //Move the customer to the first part of the process
- header('Location: ' . BWSITEURL . 'winter-mooring/stage1.php');
- exit;
Add Comment
Please, Sign In to add comment