[eluser]laytone[/eluser]
Its easiest just to write your own Auth. Look into extending your controllers with MY_Controller and implement a '_checkLogin()' function.
When you controllers extend MY_Controller(), start with the constructor and call $this->_checkLogin()
This is how the Constructors in my 'Protected' controllers look:
Code:
class Admin extends MY_Controller {
public function __construct(){
parent::__construct ();
$this->load->model('Admin_model');
//The next line of code makes sure I'm not trying to login and if I am not, it checks the login for usertype 'admin'
if ($this->uri->segment(2) != 'login') $this->_check_login('admin');
//$this->output->enable_profiler(TRUE);
}
}
Here is an example of my /application/libraries/MY_Controller.php
Code:
class MY_Controller extends Controller {
public function __construct() {
parent::Controller ();
}
function _check_login($forwhat = 'controlpanel'){
if ($this->session->userdata('loggedin') != TRUE){
redirect ($forwhat.'/login');
} else {
if ($this->session->userdata('usertype') != $forwhat){
$this->session->sess_destroy();
redirect ($forwhat.'/login');
}
}
}
}
This particular application has 3 types of users, controlpanel = end user, admin = the admins, and salesfloor = telemarketer login.
My controllers are the named after the user types so its easy to send the person to the correct login page (admin/login, controlpanel/login, salesfloor/login)
Its easy.