Ion Auth - Lightweight Auth System based on Redux Auth 2 |
[eluser]Phil Sturgeon[/eluser]
Bad! [quote author="crashfellow" date="1273601637"]Thank you for the reply I've set up the following function for login: // check for login if (!$this->ion_auth->logged_in()) { redirect(base_url() . 'auth/login.html', 'refresh'); } Which is currently working perfectly. However shouldn't there be a way in a constructor to do so? perhaps in the top of each controllers constructor?[/quote] Better Code: if (!$this->ion_auth->logged_in()) { Best Code: $this->ion_auth->logged_in() or redirect('auth/login'); Anyhow, the controllers in Ion Auth are the only as an example. You should be putting this in your Controller constructor or even better in your named Base Controller. That is all way out of scope of this simple example controller. |
Welcome Guest, Not a member yet? Register Sign In |