Welcome Guest, Not a member yet? Register   Sign In
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 Smile

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()) {
  redirect('auth/login', 'refresh');
}

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.


Messages In This Thread
Ion Auth - Lightweight Auth System based on Redux Auth 2 - by El Forum - 05-11-2010, 07:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB