function __construct() { parent::__construct(); //check to see if they are on a secure URL, this will stop them from typing in the insecure url and //attempting to force an insecure page.... why would someone do this? I dunnno.... if (!secure_page()) { secure_redirect(uri_string()); } $this->load->helper(array('formatting_helper', 'form_helper')); $this->load->model(array('Page_model', 'Settings_model', 'Location_model')); $this->load->library('Go_cart'); //make sure the cart isn't empty if ($this->go_cart->total_items() == 0) { redirect('cart/view_cart'); } //fill in our variables $this->categories = $this->Category_model->get_categories_tierd(0); $this->pages = $this->Page_model->get_pages(); $this->header_text = $this->Page_model->get_page(142); $gc_setting = $this->Settings_model->get_settings('gift_cards'); if ($gc_setting['enabled'] == 1) { $this->gift_cards_enabled = true; } if ($this->config->item('require_login')) { $this->Customer_model->is_logged_in('checkout'); } }
function __construct() { parent::__construct(); //check to see if they are on a secure URL, this will stop them from typing in the insecure url and //attempting to force an insecure page.... why would someone do this? I dunnno.... if (!secure_page()) { secure_redirect(uri_string()); } $this->load->library('Go_cart'); $this->load->model(array('Page_model', 'Product_model', 'Option_model', 'location_model')); $this->load->helper('form_helper'); $this->customer = $this->go_cart->customer(); //fill up our categories variable $this->categories = $this->Category_model->get_categories_tierd(0); $this->pages = $this->Page_model->get_pages(0, array(138)); $this->header_text = $this->Page_model->get_page(142); $gc_setting = $this->Settings_model->get_settings('gift_cards'); if (!empty($gc_setting['enabled']) && $gc_setting['enabled'] == 1) { $this->gift_cards_enabled = true; } }
<?php /*Secured user only page*/ include '../includes/constant/config.inc.php'; secure_page(); return_meta("Write your blog " . $_SESSION['fullname'] . "!"); $blogtitle = NULL; $blogentry = NULL; $userid = $_SESSION['user_id']; $msg = NULL; $err = array(); if (isset($_POST['postblog'])) { //filter is defined config.inc.php, line 258 $blogtitle = filter($_POST['blogtitle']); $blogentry = filter($_POST['blogentry']); $date = date('Y-m-d H:i:s'); $err = array(); if (empty($blogtitle) || strlen($blogentry) < 2) { $err[] = "You must enter blog title"; } if (empty($blogentry) || strlen($blogentry) < 4) { $err[] = "You must enter blog entry"; } $q2 = mysql_query("INSERT INTO " . USER_BLOG . " (id, blog_title, blog_entry, time_submitted) VALUES ('{$userid}', '{$blogtitle}', '{$blogentry}', '{$date}')", $link) or die("Unable to insert data"); //if there are no errors, set $msg to "post successful!" - later on, it is displayed on the page if (count($err) == 0) { $msg = "Blog Post Successful!"; $meta_title = "Blog Post Successful!"; } } ?>