| 12694 |
anikendra |
1 |
<?php
|
|
|
2 |
if (!defined('BASEPATH'))
|
|
|
3 |
exit('No direct script access allowed');
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
Class MY_Controller extends CI_Controller {
|
|
|
7 |
|
|
|
8 |
function __construct() {
|
|
|
9 |
// Call the CI_controller constructor
|
|
|
10 |
parent::__construct();
|
|
|
11 |
|
|
|
12 |
|
|
|
13 |
//load everything needed
|
|
|
14 |
/*$currentclient =$this -> config -> item('current_client');
|
|
|
15 |
if(!isset($currentclient))
|
|
|
16 |
{$currentclient = $this -> session -> userdata('current_client');}*/
|
|
|
17 |
|
|
|
18 |
$currentclient = $this -> config -> item('current_client');
|
|
|
19 |
$this -> load -> config($currentclient);
|
|
|
20 |
$model = $currentclient.'_model';
|
|
|
21 |
$this->load->model($model);
|
|
|
22 |
//print_r($_SERVER['SERVER_ADDR']);
|
|
|
23 |
|
|
|
24 |
}
|
|
|
25 |
|
|
|
26 |
function __fosauthorization() {
|
|
|
27 |
//sample session storage.. later i will imporve security for login
|
|
|
28 |
$check =$this->session->userdata('fosauthorize');
|
|
|
29 |
if(isset($check) and !empty($check) and $check['authority']='success') {
|
|
|
30 |
redirect(base_url().'fos/dashboard');
|
|
|
31 |
} else {
|
|
|
32 |
redirect(base_url().'fos/login');
|
|
|
33 |
}
|
|
|
34 |
}
|
|
|
35 |
}
|