[eluser]Unknown[/eluser]
Hi Guys,
I am having issue integrating Ion_Auth with HMVC by wiredesignz. First let me explain my setup.
My file structure is as follows
CodeIgniter
public_html
-- site1
-- site2
Websites
-- application1
-- -- Modules
-- application2
-- -- Modules
I have this setup working with no issues. I then get HMVC, I have no issues setting this up as well. The problem now lies when I tried to integrate ion_auth. It is showing on the auth pages that it seems the ion_auth/form_validation doesn't even exist eventhough it is: 1 being auto loaded 2 that other modules redirect it to the auth pages. I have on my core a custom controller below is the snippet. The ion_auth files are on the application folder and is not in the modules folder.
Code:
class Custom_Controller extends MX_Controller {
protected $page_data = array();
public function __construct()
{
parent::__construct();
$this->CheckAuthorization();
$this->InitializeData();
}
public function CheckAuthorization(){
if (!$this->ion_auth->logged_in())
{
if ($this->uri->segment(1) != 'auth') redirect(base_url() . 'auth/login');
}
else
{
$this->session->set_userdata($this->ion_auth->get_user());
}
}
The problem lies on the auth pages. The modules are working (provided you're logged in) specific examples are the auth/login which gives me this
Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Auth::$form_validation
Filename: controllers/auth.php
Fatal error: Call to a member function set_rules() on a non-object in <PHYSICAL_PATH> on line 50
and on auth/logout which gives me this
Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Auth::$ion_auth
Filename: controllers/auth.php
Fatal error: Call to a member function logout() on a non-object in <PHYSICAL_PATH> on line 99
If you see the line numbers to be off it's simply because of some echo and var_dump lines. Any guidance on how I can get this working is greatly appreciated. Any info you need just let me know.
Thanks