[eluser]richzilla[/eluser]
Hi all, im having a bit of a logic issue in one of my controllers, and i am going mad trying to work out whats causing the problem, ive tried absolutely everything i can think of and it just refuses to work. Basically i have my controller:
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Clients extends Controller {
function __construct()
{
parent::Controller();
if (($this->session->userdata('loggedIn') != TRUE) OR ($this->session->userdata('usergroup') != 5))
{
redirect ('login');
}
}
The above should be obvious, it should redirect anyone who is either not logged in, or not in the correct usergroup to the user page, however it doesnt, it always goes on to the next function, and then it throws a database error trying to retrieve results for a user that does not exist.
More annoyingly still, i have an identical set up in my 'admin' controller,with exactly the same code, just a different user group, and that works perfectly. Any help on this would be appreciated, as im really getting stuck in a hole trying to solve this, and if i have just managed to overlook something stupid ill be even more greatful.
Cheers