Preventing Logged in users from calling methods/functions of a controller directly. N00b here :oP |
[eluser]Bas Vermeulen[/eluser]
Welcome Let me explain what I did to block access to full controllers or methods for people who aren't logged in w/o having to do that check in each secure controller/method. I hope this helps! I extended the CI base Controller => MY_Controller (check the user guide if you don't know how to do that: http://ellislab.com/codeigniter/user-gui...asses.html). I used the term index for stuff that is allowed to be used by people who aren't logged in. I added a the following to my config file: Code: /* The following goes into the construct method of MY_Controller (I removed some stuff to show the part that matters): Code: if($is_logged_in) { I think with this info you should be able to fix what you want? |
Messages In This Thread |
Preventing Logged in users from calling methods/functions of a controller directly. N00b here :oP - by El Forum - 10-10-2010, 03:59 AM
Preventing Logged in users from calling methods/functions of a controller directly. N00b here :oP - by El Forum - 10-10-2010, 04:14 AM
Preventing Logged in users from calling methods/functions of a controller directly. N00b here :oP - by El Forum - 10-10-2010, 04:25 AM
Preventing Logged in users from calling methods/functions of a controller directly. N00b here :oP - by El Forum - 10-10-2010, 04:35 AM
Preventing Logged in users from calling methods/functions of a controller directly. N00b here :oP - by El Forum - 10-10-2010, 04:41 AM
Preventing Logged in users from calling methods/functions of a controller directly. N00b here :oP - by El Forum - 10-11-2010, 07:11 AM
|