Fixed ion_auth_model can't access ion_auth property when auto login. #46

Merged
1 commit merged into from Feb 21, 2011

Conversation

Projects
None yet
2 participants
@harryxu
Contributor

harryxu commented Feb 18, 2011

In the Ion_auth class' __construct function, it load the ion_auth_model, and then check the auto-login, when calling $this->ci->ion_auth_model->login_remembered_user(), the Ion_auth class were not finished init.

So, in the Ion_auth_model's login_remembered_user function, it can't using $this->ion_auth, the ion_auth property is null, on the line 965:

if (isset($this->ion_auth->_extra_where))

This line may cause the issue.

Sorry for my English, hope this help.

@benedmunds

This comment has been minimized.

Show comment Hide comment
@benedmunds

benedmunds Feb 18, 2011

Owner

Hey dude,

Thank you for looking into this. Since CI2.0 this is an outstanding bug but I haven't been able to reproduce. Can you do me a favor and determine if the error is from the isset() check for the extra _where in the login_remembered_user() or if it is that function call. I think it is an isset check somewhere.

Owner

benedmunds commented Feb 18, 2011

Hey dude,

Thank you for looking into this. Since CI2.0 this is an outstanding bug but I haven't been able to reproduce. Can you do me a favor and determine if the error is from the isset() check for the extra _where in the login_remembered_user() or if it is that function call. I think it is an isset check somewhere.

@harryxu

This comment has been minimized.

Show comment Hide comment
@harryxu

harryxu Feb 18, 2011

Contributor

Yeah, it form the isset() check for the extra _where, I delete some code like:

    if (isset($this->ion_auth->_extra_where))
    {
    $this->db->where($this->ion_auth->_extra_where);
    }

in login_remembered_user(), and the errors gone.

There are 2 places cause the error, the first is line 965, and the second is line 981, the update_last_login() will check $this->ion_auth->_extra_where too.

Contributor

harryxu commented Feb 18, 2011

Yeah, it form the isset() check for the extra _where, I delete some code like:

    if (isset($this->ion_auth->_extra_where))
    {
    $this->db->where($this->ion_auth->_extra_where);
    }

in login_remembered_user(), and the errors gone.

There are 2 places cause the error, the first is line 965, and the second is line 981, the update_last_login() will check $this->ion_auth->_extra_where too.

@benedmunds

This comment has been minimized.

Show comment Hide comment
@benedmunds

benedmunds Feb 18, 2011

Owner

Awesome, looks great dude!

Thanks for the help, I'll test and merge sometime this weekend.

Owner

benedmunds commented Feb 18, 2011

Awesome, looks great dude!

Thanks for the help, I'll test and merge sometime this weekend.

@benedmunds

This comment has been minimized.

Show comment Hide comment
@benedmunds

benedmunds Feb 21, 2011

Owner

Modified a little and merged in. Thanks again dude!

Owner

benedmunds commented Feb 21, 2011

Modified a little and merged in. Thanks again dude!

@harryxu

This comment has been minimized.

Show comment Hide comment
@harryxu

harryxu Feb 21, 2011

Contributor

I'm glad I could help. :)

Contributor

harryxu commented Feb 21, 2011

I'm glad I could help. :)

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment