[eluser]doubleplusgood[/eluser]
Right, I seemingly now have the redirect working again.
I have now changed the DB to match your example. So the account type is now set by a group field that is either 'dealer' or 'public.
The controller now successfully redirects to the relevant page when logged in;
Code:
public function login()
{
$email = $this->input->post('email');
$password = $this->input->post('password');
$logged_in = $this->auth->login($email, $password);
if($logged_in == FALSE)
redirect('auth/login'); //bad login buddy
$uri = ($logged_in['group'] == 'dealer') ? 'vehicle_list' : 'vehicle_publiclist'; //what group are we in
//die(print_r($logged_in));
redirect('account/'.$uri);
}
However, when a user now logs in, they always see the partials/subnav instead of the account specific partial;
Code:
$logged = $this->auth->logged_in();
if ( $logged['group'] == 'public' ){
$this->load->view('partials/public_toolbar');
}elseif($logged['group'] == 'dealer' ){
$this->load->view('partials/dealer_toolbar');
}else{
$this->load->view('partials/subnav');
}
This is the print_r for $logged_in when i'm logged in as a dealer, which correctly shows the group set;
Array ( [id] => 46 [group_id] => 1 [email] => EMIAL [password] => HASH [salt] => SALT [first_name] => [last_name] => [reset_password_hash] => [active] => 1 [username] => dealertest [credits] => 10 [business_name] => dealer [business_address] => [business_region] => 9 [business_postcode] => [business_description] => [business_services] => [business_email] => [business_phone] => [business_website] => [business_photo] => [created_on] => 2010-05-25 20:59:34 [image1] => [image2] => [image3] => [image4] => [isDealer] => [isPublic] => [group] => dealer ) 1