Welcome Guest, Not a member yet? Register   Sign In
HMVC and Ion Auth
#1

[eluser]Semaphore[/eluser]
Hi,
I'm a french newbie on CI.
I'm tryong to mix HMVC and Ion Auth like said il this tutorial but i still have error like this :.

I have make a lot of test but I don't understand where the error is...

A PHP Error was encountered

Severity: Notice

Message: Undefined property: CI::$ci

Filename: libraries/Ion_auth.php

Line Number: 105


A PHP Error was encountered


Severity: Notice

Message: Trying to get property of non-object

Filename: libraries/Ion_auth.php

Line Number: 53


Fatal error:
Call to a member function config() on a non-object in /home/soreve/public_html/application/modules/auth/libraries/Ion_auth.php on line 53


Thanks for your help

ps : My lib/Ion_auth.php construct code
Code:
public function __construct()
{
  $this->ci->load->config('auth/ion_auth', TRUE);
  $this->ci->load->library('email');
  $this->ci->load->library('session');
  $this->ci->lang->load('auth/ion_auth');
  $this->load->helper('cookie');
  $this->ci->load->model('auth/ion_auth_model');

The controller/auth.php construct's code
Code:
public function __construct()
{
  parent::__construct();
  $this->load->database();
  $this->load->config('auth/ion_auth', TRUE);
  $this->load->helper('cookie');
  $this->load->helper('date');
  $this->load->library('session');
  $this->lang->load('auth/ion_auth');
#2

[eluser]Rok Biderman[/eluser]
Here is a mod for HMVC I made some time ago. It might help.
#3

[eluser]Semaphore[/eluser]
Hi, Thanks for your work.
I had to change My_Controller to MX_controller is that normal ?
#4

[eluser]Rok Biderman[/eluser]
That's perfectly normal. If you check my repo again, you will find a MY_Controller.php inside a core folder. When I commited this I was extending the base controller (for purposes other than auth), but since you don't have one, you use MX. You can read about creating core classes here, it may come in handy.
#5

[eluser]Semaphore[/eluser]
Okay,
I asked for other ppl who want to try your repo ;-)
Now that's working if I use the
Code:
Modules::run( 'auth' )
code for loading ion auth as a module (in the native welcome page for example) it's redirect to the auth page due to the
Code:
redirect('auth/login', 'refresh');
I think. Where is my error ? I don't understand why I have see on forums a lot of ppl explaining how to mix HMVC and ion auth and don't talk about this issue ?
#6

[eluser]Semaphore[/eluser]
Hi,
I don't success in login with the default password or anyone. I have no error. I thinks it's a pb with form validation because it seems
Code:
$this->form_validation->run() == true
is not validate.

Thanks for your help guys
#7

[eluser]Rok Biderman[/eluser]
hey semaphore, check the repo again, I've made a welcome module that should show you how to use it in default page. You might have to fix the redirects if you wished it differently, but that is all.

You will have to be more specific with your login problem. i don't think it has anything to do with HMVC so you could ask in the Ion Auth thread.
#8

[eluser]Semaphore[/eluser]
Hi,
Thanks for the welcome demo.
After hours spending in test I have re-install all CI+HMVC+your Ion mod => No pb.. Sighhh

Thanks again,
#9

[eluser]Semaphore[/eluser]
Hi !
I'm back on this projet and my first try with logged_in()method withis simple code :
Code:
<?php
class Lumiere extends MX_Controller {
public function index()
{
if ($this->ion_auth->logged_in()){
  $data = array('titre'=>'Dashboard lumiere') ;
  $this->load->view('lumiere', $data);
}
}
}

give me this result :
Code:
Unable to locate the model you have specified: ion_auth_model

Where is the pb in my code?

edit : of course ion auth lib is in autoload

Thanks for your help




Theme © iAndrew 2016 - Forum software by © MyBB