[eluser]livestrong[/eluser]
Hello, need some help from the community.
I have several admin controllers. And I want to restrict access to methods of these controllers to everybody except admin. In order to do so I added verification of user's id to the constructor. See below:
Code:
class Cities extends Controller {
function Cities()
{
parent::Controller();
$this->load->model('cities_model');
if ($this->session->userdata('user_id') != 1)
{
redirect("/");
}
}
function Foo()
{
...
}
Now when I try to access any method from Cities controller, I'm redirected. That is correct. But in spite of this function is executed also. That shouldn't happen, if I'm correct.
Can anyone assist with this problem?