Welcome Guest, Not a member yet? Register   Sign In
General question about framework extensions (also Ion Auth)
#2

[eluser]Jelmer[/eluser]
I think you need to read up a bit more on what exactly a controller is. Auth normally needs to be checked from everywhere, not just from within a single Auth controller. You can only use 1 controller at a time, so if you implement Auth using a controller you can't use those functions anywhere else.

The best way is almost always to implement it as a library (likely using a few models for users and roles). And then to either put it in the autoload.php config file or use it something like this for a controller that always needs a login (like an Admin):

Code:
Class Admin extends Controller {
    function __construct() {
        parent::__construct();
        $this->load->library('Auth');
        $this->auth->check_login();
    }

    ...
}

But mostly read up a bit more on the MVC pattern as implemented by CI because I'm getting the feeling you're not fully grasping the basics.


Messages In This Thread
General question about framework extensions (also Ion Auth) - by El Forum - 06-14-2010, 03:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB