[eluser]Huji[/eluser]
I've successfully used Simplelogin library to setup a basic authentication system within a few minutes. I have several functions in my controller, and in the beginning of most of them, I have to check if the user is logged in like this:
function Blah(){
if(!$this->session->userdata('logged_in')) {
redirect('/login/');
} else {
// DO WHATEVER YOU DO
}
}
I would like to know if there is a way to get rid of this if statement? Like by extending from a base function, etc?