Welcome Guest, Not a member yet? Register   Sign In
Login redirects
#11

[eluser]doubleplusgood[/eluser]
Right, I seemingly now have the redirect working again. Big Grin
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


Messages In This Thread
Login redirects - by El Forum - 05-25-2010, 09:28 AM
Login redirects - by El Forum - 05-25-2010, 11:20 AM
Login redirects - by El Forum - 05-25-2010, 11:52 AM
Login redirects - by El Forum - 05-25-2010, 11:57 AM
Login redirects - by El Forum - 05-25-2010, 01:26 PM
Login redirects - by El Forum - 05-25-2010, 01:55 PM
Login redirects - by El Forum - 05-25-2010, 02:05 PM
Login redirects - by El Forum - 05-25-2010, 02:25 PM
Login redirects - by El Forum - 05-25-2010, 02:39 PM
Login redirects - by El Forum - 05-25-2010, 02:51 PM
Login redirects - by El Forum - 05-25-2010, 03:43 PM
Login redirects - by El Forum - 05-25-2010, 04:51 PM
Login redirects - by El Forum - 05-25-2010, 05:07 PM
Login redirects - by El Forum - 05-25-2010, 06:22 PM
Login redirects - by El Forum - 05-25-2010, 06:26 PM
Login redirects - by El Forum - 05-25-2010, 06:39 PM
Login redirects - by El Forum - 05-25-2010, 07:00 PM
Login redirects - by El Forum - 05-25-2010, 07:13 PM
Login redirects - by El Forum - 05-25-2010, 07:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB