Ok. What about a different approach. What about a table called redirect_groups 2 columns.
Id, int(11), auto increment
and redirect,varchar(255)
Every time you insert a row into the db you put the path of the page you want that "group" to redirect to.
Then in your users table, you can either create a new column or use the unused account_id column.
Store the place you want that person to redirect in that column.
Then just make a function like
function redir($id){
$db = DB::getInstance();
$userQ = $db->query("SELECT account_id FROM user WHERE id = ?",array($id));
$found = $userQ->first();
$redirQ = $db->query("SELECT * FROM redirect_groups WHERE id = ?",array($found->account_id));
$redir = $redirQ->first();
Redirect::to($redir->redirect);
}
if that's not it for the function, it's close.
The other idea would be to make your user account levels a hierarchy. So, let's assume level 1 (user) is only for unvalidated users. 2 is admin. Then put your highest level user groups with the lowest level numbers. Then you can do a search of all the users and their permissions to find out what the highest (in this case lowest) permission level they have. So, your query would look like this.
$highestQ = $db->query("SELECT * FROM user_permission_matches WHERE permission_id !=1 AND user_id = ?",array($user->data()->id);
$highest = $highestQ->first();
//That just gave you the highest permission level that user has.
So now you make that same table.
if($highest==2){ //admin
Redirect::to('blah');
}
Basically this deals with users having multiple permission levels.