Subversion Repositories SmartDukaan

Rev

Rev 12694 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php
if (!defined('BASEPATH'))
        exit('No direct script access allowed');


Class MY_Controller extends CI_Controller {

        function __construct() {
                // Call the CI_controller constructor
                parent::__construct();


                //load everything needed
                /*$currentclient =$this -> config -> item('current_client');
                if(!isset($currentclient))
                {$currentclient = $this -> session -> userdata('current_client');}*/

                $currentclient = $this -> config -> item('current_client');
                $this -> load -> config($currentclient);
                $model = $currentclient.'_model';
                $this->load->model($model);             
                //print_r($_SERVER['SERVER_ADDR']);
                
        }

        function __fosauthorization()   {
                //sample session storage.. later i will imporve security for login 
                $check =$this->session->userdata('fosauthorized');
                if(isset($check) and !empty($check) and $check['authority']='success') {
                        //redirect(base_url().'fos/dashboard');
                } else {
                        redirect(base_url().'fos/login');
                }       
        }
}