Welcome Guest, Not a member yet? Register   Sign In
Erkanauth class - checking if user is logged in
#1

[eluser]andriu[/eluser]
Hi

I'm still a bit new to CI an OOP.

At the moment to check if a user is logged in I check in every function
ex.:
Code:
function index()
    {
        if (!$this->erkanaauth->try_session_login())
        {
            redirect('admin/login');
          }else {
            
            $this->load->view('admin/page');
        }
    }

There must be a more efficient way to do this so I don't have to repeat the same code.

Thanks for any help.


Messages In This Thread
Erkanauth class - checking if user is logged in - by El Forum - 10-19-2009, 08:38 PM
Erkanauth class - checking if user is logged in - by El Forum - 10-19-2009, 09:32 PM
Erkanauth class - checking if user is logged in - by El Forum - 10-19-2009, 09:58 PM
Erkanauth class - checking if user is logged in - by El Forum - 10-20-2009, 11:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB