• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.