Welcome Guest, Not a member yet? Register   Sign In
Controller Security
#1

[eluser]rigniter[/eluser]
Hi -
Is there a way in CI to secure certain controllers or even function within controllers.
Let's take below code as example:

class User extends Controller {

//this is open to public
function index ()
{

}

//this requires login
function profile ()
{
>>Check whether user is logged in<<
}

//this is open to public
function highestrateduser()
{

}

}

Do I need to secure each controller in the above, or is there something that we can invoke in the config level to do this?
This can get very hairy as your code grows.

Thanks,
#2

[eluser]nmweb[/eluser]
Use a MY_Controller (see user guide) so all your controllers execute the is_logged_in() code.




Theme © iAndrew 2016 - Forum software by © MyBB