Welcome Guest, Not a member yet? Register   Sign In
Login System - Code Igniter just makes things excessively complex..
#6

[eluser]WanWizard[/eluser]
That doesn't matter.

Just add code to the constructor of the MY_Controller to do the preparation, like retrieve the logged-in state from the session, store it somewhere, etc. You can add a is_logged_in() method to your MY_Controller.

Then, in the constructor of your controller, call the parent contructor first. After that, you can call $this->is_logged_in() to fetch the logged in state, and act upon it (p.e. redirect or show an error if the user is not logged in or has no access). Then, in your controller method, use the same method to selectively load data into the view array. You can put the result in the view array as well, so you can have "if logged in then" sections in your view file.


Messages In This Thread
Login System - Code Igniter just makes things excessively complex.. - by El Forum - 08-15-2010, 02:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB