Пример #1
0
 function __construct()
 {
     parent::__construct();
     force_ssl();
     /*make sure the cart isnt empty*/
     if ($this->go_cart->total_items() == 0) {
         redirect('cart/view_cart');
     }
     /*is the user required to be logged in?*/
     if (config_item('require_login')) {
         $this->Customer_model->is_logged_in('checkout');
     }
     if (!config_item('allow_os_purchase') && config_item('inventory_enabled')) {
         /*double check the inventory of each item before proceeding to checkout*/
         $inventory_check = $this->go_cart->check_inventory();
         if ($inventory_check) {
             /*
             OOPS we have an error. someone else has gotten the scoop on our customer and bought products out from under them!
             we need to redirect them to the view cart page and let them know that the inventory is no longer there.
             */
             $this->session->set_flashdata('error', $inventory_check);
             redirect('cart/view_cart');
         }
     }
     /* Set no caching
     	
     		header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
     		header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); 
     		header("Cache-Control: no-store, no-cache, must-revalidate"); 
     		header("Cache-Control: post-check=0, pre-check=0", false);
     		header("Pragma: no-cache");
     	
     		*/
     $this->load->library('form_validation');
 }
Пример #2
0
 function __construct()
 {
     parent::__construct();
     force_ssl();
     $this->load->model(array('location_model'));
     $this->load->helper(array('form', 'url'));
 }
Пример #3
0
 function __construct()
 {
     parent::__construct();
     force_ssl();
     $this->load->library('Auth');
     $this->lang->load('login');
 }
Пример #4
0
 function form($id = false)
 {
     force_ssl();
     //echo "<pre>"; print_r($_FILES); print_r($_POST); die;
     $this->load->helper('form');
     $this->load->library('form_validation');
     $data['page_title'] = 'Add/Edit Deal City';
     //default values are empty if the deal_type is new
     $data['id'] = '';
     $data['name'] = '';
     if ($id) {
         $this->deal_city_id = $id;
         $deal_city = $this->Deal_cities_model->get_deal_city($id);
         //if the deal_type does not exist, redirect them to the deal_type list with an error
         if (!$deal_city) {
             $this->session->set_flashdata('error', 'The requested city is not found');
             redirect($this->config->item('admin_folder') . '/deal_cities');
         }
         //set values to db values
         $data['id'] = $deal_city->id;
         $data['name'] = $deal_city->name;
     }
     $this->form_validation->set_rules('name', 'Name', 'trim|required');
     if ($this->form_validation->run() == FALSE) {
         $this->load->view($this->config->item('admin_folder') . '/deal_city_form', $data);
     } else {
         $save['id'] = $id;
         $save['name'] = $this->input->post('name');
         $this->Deal_cities_model->save($save);
         $this->session->set_flashdata('message', 'City saved successfully');
         //go back to the deal_city list
         redirect($this->config->item('admin_folder') . '/deal_cities');
     }
 }
Пример #5
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model('Messages_model');
     $this->load->model('Application_model');
     $this->load->model('Users_model');
     $this->load->model('Programs_model');
     $this->load->library('session');
     $this->load->library('fpdf');
     $this->load->library('tank_auth');
     $this->load->helper('form');
     $this->load->model('tank_auth/users');
     $this->load->helper('debugger.inc');
     if (!$this->tank_auth->is_logged_in()) {
         redirect('/auth/login');
     }
     force_ssl();
     // Set values in session to be used across the site
     $user = $this->users->get_user_by_id($this->tank_auth->get_user_id(), true);
     $this->session->set_userdata('uid', $this->Users_model->getUIDByEmail($user->email));
     $this->session->set_userdata('item_id', $this->Users_model->getProgramIDByEmail($user->email));
     $this->session->set_userdata('has_stp', $this->Programs_model->has_stp($this->session->userdata('item_id')));
     $this->session->set_userdata('program_name', $this->Programs_model->get_program_name($this->session->userdata('item_id')));
     // grab session UID and log out if something went wrong
     $this->uid = $this->session->userdata('uid');
     $this->item_id = $this->session->userdata('item_id');
     $this->program_name = $this->session->userdata('program_name');
     if ($this->uid == NULL) {
         $this->tank_auth->logout();
     }
     $mongo_user = $this->Users_model->get_user_by_uid($this->uid);
     if (!isset($mongo_user['type']) || !strstr($mongo_user['type'], "EC")) {
         //$this->Users_model->update_user_from_dw_leads($this->uid);
     }
 }
Пример #6
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model('Messages_model');
     $this->load->helper('date');
     force_ssl();
 }
Пример #7
0
 function __construct()
 {
     parent::__construct();
     force_ssl();
     $this->load->model(array('location_model'));
     $this->customer = $this->go_cart->customer();
 }
Пример #8
0
 public function __construct()
 {
     parent::__construct();
     if ($this->config->item('ssl')) {
         force_ssl();
     }
 }
Пример #9
0
 function __construct()
 {
     parent::__construct();
     force_ssl();
     /* make sure the cart isnt empty */
     if ($this->go_cart->total_items() == 0) {
         redirect('cart/view_cart');
     }
     /* is the user required to be logged in? */
     if (config_item('require_login')) {
         $this->Customer_model->is_logged_in('checkout');
     }
     if (!config_item('allow_os_purchase') && config_item('inventory_enabled')) {
         /* double check the inventory of each item before proceeding to checkout */
         $inventory_check = $this->go_cart->check_inventory();
         if ($inventory_check) {
             /*
              OOPS we have an error. someone else has gotten the scoop on our customer and bought products out from under them!
              we need to redirect them to the view cart page and let them know that the inventory is no longer there.
             */
             $this->session->set_flashdata('error', $inventory_check);
             redirect('cart/view_cart');
         }
     }
     $this->load->library('form_validation');
 }
Пример #10
0
 function __construct()
 {
     parent::__construct();
     // Load in the admin helper functions if the current user is an administrator
     if ($this->secure->group_types(array(ADMINISTRATOR))->is_auth()) {
         $this->load->helper('admin_helper');
     }
     $this->cms_parameters = array();
     $this->cms_base_route = '';
     // Check if to force ssl on controller
     if (in_uri($this->config->item('ssl_pages'))) {
         force_ssl();
     } else {
         remove_ssl();
     }
     // Create Dynamic Page Title
     if (!($title = str_replace('-', ' ', $this->uri->segment(1)))) {
         $title = 'Home';
     }
     if ($segment2 = str_replace('-', ' ', $this->uri->segment(2))) {
         $title = $segment2 . " - " . $title;
     }
     $this->template->set_meta_title(ucwords($title) . " | " . $this->settings->site_name);
     // Set Group
     if ($this->session->userdata('user_session')) {
         $this->group_id = $this->session->userdata('user_session')->group_id;
         $this->Group_session = $this->session->userdata('group_session');
     }
 }
Пример #11
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model('Messages_model');
     $this->load->model('Application_model');
     $this->load->model('Users_model');
     $this->load->library('session');
     $this->load->library('fpdf');
     $this->load->library('tank_auth');
     $this->load->helper('form');
     $this->load->library('email');
     $this->load->model('tank_auth/users');
     $this->load->helper('debugger.inc');
     if (!$this->tank_auth->is_logged_in()) {
         redirect('/auth/login');
     }
     force_ssl();
     $user = $this->users->get_user_by_id($this->tank_auth->get_user_id(), true);
     $this->session->set_userdata('uid', $this->Users_model->getUIDByEmail($user->email));
     // grab session UID and log out if something went wrong
     $this->uid = $this->session->userdata('uid');
     if ($this->uid == NULL) {
         $this->tank_auth->logout();
     }
 }
Пример #12
0
 public function __construct()
 {
     parent::__construct();
     date_default_timezone_set('America/New_York');
     $this->load->model('Application_model');
     $this->load->model('Programs_model');
     $this->load->model('Users_model');
     $this->load->model('Messages_model');
     $this->load->model('School_model');
     $this->load->model('Programs_model');
     $this->load->library('session');
     $this->load->library('tank_auth');
     $this->load->library('email');
     $this->load->library(SITE, '', 'school_lib');
     $this->load->helper('date');
     $this->portal_entity_id = $this->Programs_model->get_entity_id_for_current_site();
     if (!$this->tank_auth->is_logged_in()) {
         redirect('/auth/login');
     }
     // Grab session UID and log out if something went wrong
     $this->uid = $this->session->userdata('uid');
     if ($this->uid == NULL) {
         $this->tank_auth->logout();
     }
     // Grab some user data, stick it in session to be used later
     $user = $this->users->get_user_by_id($this->tank_auth->get_user_id(), true);
     $this->session->set_userdata('item_id', $this->Users_model->getProgramIDByEmail($user->email));
     $this->session->set_userdata('has_stp', $this->Programs_model->has_stp($this->session->userdata('item_id')));
     $this->item_id = $this->session->userdata('item_id');
     $this->user_progress = $this->Users_model->getProgress($this->uid);
     force_ssl();
 }
Пример #13
0
 public function __construct()
 {
     parent::__construct();
     date_default_timezone_set('America/New_York');
     $this->load->model('Application_model');
     $this->load->model('Users_model');
     $this->load->library('session');
     $this->load->library('fpdf');
     $this->load->library('tank_auth');
     $this->load->library(SITE, '', 'school_lib');
     $this->load->helper('form');
     $this->load->library('email');
     $this->load->model('tank_auth/users');
     if (!$this->tank_auth->is_logged_in()) {
         redirect('/auth/login');
     }
     force_ssl();
     $user = $this->users->get_user_by_id($this->tank_auth->get_user_id(), true);
     $this->session->set_userdata('uid', $this->Users_model->getUIDByEmail($user->email));
     $this->session->set_userdata('client_program_id', $this->Users_model->getProgramIDByEmail($user->email));
     $this->client_program_id = $this->session->userdata('client_program_id');
     // grab session UID and log out if something went wrong
     $this->uid = $this->session->userdata('uid');
     if ($this->uid == NULL) {
         $this->tank_auth->logout();
     }
 }
Пример #14
0
 function __construct()
 {
     parent::__construct();
     if ($this->config->item('ssl')) {
         force_ssl();
     }
     $this->load->helper('xml');
 }
Пример #15
0
 function __construct()
 {
     parent::__construct();
     if ($this->config->item('ssl')) {
         force_ssl();
     }
     UsuarioBackendSesion::checkLogin();
 }
Пример #16
0
 function __construct()
 {
     parent::__construct();
     force_ssl();
     $this->auth->check_access('Admin', true);
     $this->load->model('Settings_model');
     $this->lang->load('settings');
 }
Пример #17
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model('Application_model');
     $this->load->helper('date');
     $this->load->helper('download');
     force_ssl();
 }
Пример #18
0
 function form($id = false)
 {
     force_ssl();
     $this->load->helper('form');
     $this->load->library('form_validation');
     $this->form_validation->set_error_delimiters('<div class="error">', '</div>');
     $data['page_title'] = lang('admin_form');
     //default values are empty if the customer is new
     $data['id'] = '';
     $data['company'] = '';
     $data['firstname'] = '';
     $data['lastname'] = '';
     $data['email'] = '';
     $data['access'] = '';
     if ($id) {
         $this->admin_id = $id;
         $admin = $this->auth->get_admin($id);
         //if the administrator does not exist, redirect them to the admin list with an error
         if (!$admin) {
             $this->session->set_flashdata('message', lang('admin_not_found'));
             redirect($this->config->item('admin_folder') . '/admin');
         }
         //set values to db values
         $data['id'] = $admin->id;
         $data['company'] = $admin->company;
         $data['firstname'] = $admin->firstname;
         $data['lastname'] = $admin->lastname;
         $data['email'] = $admin->email;
         $data['access'] = $admin->access;
     }
     $this->form_validation->set_rules('company', 'Company', 'trim|required');
     $this->form_validation->set_rules('firstname', 'lang:firstname', 'trim|max_length[32]');
     $this->form_validation->set_rules('lastname', 'lang:lastname', 'trim|max_length[32]');
     $this->form_validation->set_rules('email', 'lang:email', 'trim|required|valid_email|max_length[128]|callback_check_email');
     $this->form_validation->set_rules('access', 'lang:access', 'trim|required');
     //if this is a new account require a password, or if they have entered either a password or a password confirmation
     if ($this->input->post('password') != '' || $this->input->post('confirm') != '' || !$id) {
         $this->form_validation->set_rules('password', 'lang:password', 'required|min_length[6]|sha1');
         $this->form_validation->set_rules('confirm', 'lang:confirm_password', 'required|matches[password]');
     }
     if ($this->form_validation->run() == FALSE) {
         $this->load->view($this->config->item('admin_folder') . '/admin_form', $data);
     } else {
         $save['id'] = $id;
         $save['company'] = $this->input->post('company');
         $save['firstname'] = $this->input->post('firstname');
         $save['lastname'] = $this->input->post('lastname');
         $save['email'] = $this->input->post('email');
         $save['access'] = $this->input->post('access');
         if ($this->input->post('password') != '' || !$id) {
             $save['password'] = $this->input->post('password');
         }
         $this->auth->save($save);
         $this->session->set_flashdata('message', lang('message_user_saved'));
         //go back to the customer list
         redirect($this->config->item('admin_folder') . '/admin');
     }
 }
Пример #19
0
 function __construct()
 {
     parent::__construct();
     force_ssl();
     $this->auth->check_access('Admin', true);
     $this->load->model('Coupon_model');
     $this->load->model('Product_model');
     $this->lang->load('coupon');
 }
Пример #20
0
 function __construct()
 {
     parent::__construct();
     force_ssl();
     $this->load->model('Settings_model');
     $this->load->model('Gift_card_model');
     $this->load->helper('form');
     $this->load->library('form_validation');
     $this->lang->load('giftcard');
 }
Пример #21
0
 function __construct()
 {
     parent::__construct();
     force_ssl();
     $this->load->model('Customer_model');
     $this->load->model('Course_model');
     $this->load->model(array('location_model'));
     $this->load->helper(array('form', 'url'));
     $this->customer = $this->go_cart->customer();
 }
Пример #22
0
 function check_ssl()
 {
     $CI =& get_instance();
     $class = $CI->router->fetch_class();
     $ssl = array('auth', 'ajax', 'backend', 'errors', 'feed', 'lists', 'manage', 'mixtapes', 'oembed', 'player', 'playlists', 'search', 'site', 'songs', 'upload', 'videos', 'votes');
     if (in_array($class, $ssl) || !$CI->uri->segment('1')) {
         force_ssl();
     } else {
         unforce_ssl();
     }
 }
Пример #23
0
 function __construct()
 {
     parent::__construct();
     if ($this->config->item('ssl')) {
         force_ssl();
     }
     UsuarioBackendSesion::checkLogin();
     if (!UsuarioBackendSesion::usuario()->tieneRol('mantenedor')) {
         echo 'No tiene permisos';
         exit;
     }
 }
Пример #24
0
 function __construct()
 {
     parent::__construct();
     force_ssl();
     $this->auth->check_access('Admin', true);
     $this->load->model('Coupon_model');
     $this->load->helper('formatting_helper');
     $this->load->model('Product_model');
     $this->lang->load('coupon');
     $this->load->helper('url');
     $this->load->helper(array('formatting'));
 }
Пример #25
0
 function __construct()
 {
     parent::__construct();
     if ($this->config->item('ssl')) {
         force_ssl();
     }
     $this->user = UsuarioBackendSesion::usuario();
     UsuarioBackendSesion::checkLogin();
     if (!$this->user->tieneRol(array('mantenedor', 'jefaturaweb'))) {
         echo 'No tiene permisos';
         return;
     }
 }
Пример #26
0
 public function __construct()
 {
     if (ENVIRONMENT == 'prod') {
         die('RESTRICTED! No setup scripts allowed here');
     }
     parent::__construct();
     $this->load->library('session');
     $this->load->library('tank_auth');
     $this->load->library('studentportal');
     $this->load->model('tank_auth/users');
     $this->load->model('Setup_model');
     $this->load->helper('debugger.inc');
     force_ssl();
 }
Пример #27
0
 public function __construct()
 {
     parent::__construct();
     date_default_timezone_set('America/New_York');
     $this->load->model('Application_model');
     $this->load->model('Users_model');
     $this->load->model('Messages_model');
     $this->load->model('School_model');
     $this->load->library('session');
     $this->load->library('tank_auth');
     $this->load->library('email');
     $this->load->library(SITE, '', 'school_lib');
     $this->load->helper('date');
     force_ssl();
 }
Пример #28
0
function check_ssl()
{
    $CI =& get_instance();
    $class = $CI->router->fetch_class();
    $ssl = array();
    $partial = array();
    if (in_array($class, $ssl)) {
        force_ssl();
    } else {
        if (in_array($class, $partial)) {
            return;
        } else {
            unforce_ssl();
        }
    }
}
Пример #29
0
 function __construct()
 {
     parent::__construct();
     $this->load->helper('url');
     $this->load->library('Auth_front');
     $this->load->library('session');
     $this->lang->load('merchant');
     //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....
     force_ssl();
     $this->load->model(array('Merchant_model', 'Deal_type_model'));
     $this->load->helper('form_helper');
     $this->merchant = $this->auth_front->logged_data();
     $this->setting = $this->Settings_model->get_setting();
     //load the theme package
     $this->load->add_package_path(APPPATH . 'themes/' . $this->config->item('theme') . '/');
 }
 /**
  * Initialise the controller, tie into the CodeIgniter superobject
  * and try to autoload the models
  */
 public function __construct()
 {
     parent::__construct();
     //If the page is a SSL Page redirect to its place
     if ($this->ssl_page == true && $this->config->item('use_ssl') == true) {
         force_ssl();
     } else {
         remove_ssl();
     }
     //Load the models
     $this->_load_models();
     //Get any error messages
     $this->_get_messages();
     //Get any validation data / errors to pass back to the form
     $this->_get_validation_errors();
     //Check any session tracking paramaters that should be in here
     $this->_session();
 }