Welcome Guest, Not a member yet? Register   Sign In
autoload libraries loaded in wrong order when enforcing .htaccess login
#1

[eluser]ipsod[/eluser]
I've got an .htaccess login setup on my development directory, and whenever it prompts for login, I get this error once the page loads:

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: AdminHome::$ion_auth

Filename: core/Model.php

Line Number: 50


This is the code it's complaining about (note ion_auth is an autoloaded library):
Code:
class Admin_Controller extends MY_Controller {

    function __construct()
    {
        parent::__construct();

        if( !$this->ion_auth->is_admin() )
        {
            redirect( 'login' );
        }
    }
}

This is in 2.0, and didn't happen in 1.7. It doesn't happen when I'm not prompted for login by .htaccess (and thus isn't a big deal). Bug, or no?
#2

[eluser]Ben Edmunds[/eluser]
Here is the temporary solution until we re-work Ion Auth to conform to this CI2.0 change:

https://bitbucket.org/ellislab/codeignit...when-using
#3

[eluser]ipsod[/eluser]
Thank you!
#4

[eluser]jmadsen[/eluser]
thank you from me, as well.

Time from finding unexplained error to finding posted solution: maybe 10 seconds?

Keep up the great support!




Theme © iAndrew 2016 - Forum software by © MyBB