Welcome Guest, Not a member yet? Register   Sign In
Protecting modules from users not logged in
#1

[eluser]Patrick Reck[/eluser]
Hello!

I'm developing a new website using HMVC patterns. I was wondering how to protect <b>whole</b> modules against users who is not logged in.

As far as I can see, putting the following code in the <i>Controllers constructor</i> seems to work:

Code:
if ($this->session->userdata('is_logged_in') == NULL) { exit; }

Is this a safe approach to keep non-users out?
#2

[eluser]Harold Villacorte[/eluser]
Redirect the user.




Theme © iAndrew 2016 - Forum software by © MyBB