Welcome Guest, Not a member yet? Register   Sign In
Question about tank_auth
#1

[eluser]oualid[/eluser]
Hi.

I downloaded the library tank_auth and I am testing it.

I have a question about the login function:

I created a new file welcome2.php under controller:
/controller/welcome2.php

Code:
class Welcome2 extends Controller
{
    function __construct()
    {
        parent::__construct();

        $this->load->helper('url');
        $this->load->library('tank_auth');
    }

    function index()
    {
        if (!$this->tank_auth->is_logged_in()) {
            redirect('/auth/login/');
        } else {
            $data['user_id']    = $this->tank_auth->get_user_id();
            $data['username']    = $this->tank_auth->get_username();
            $this->load->view('welcome2', $data);
        }
    }
}

The file welcome.php is exactly the same.

In config.php I changed: $config['sess_use_database'] value to TRUE.

and

routes.php: $route['default_controller'] = "welcome";


When I login to welcome2.php I will be redirected to welcome.php because of the setting in routes.php.
What should I do to redirect to welcome2.php instead to welcome.php?

Best regards.

/Oualid


Messages In This Thread
Question about tank_auth - by El Forum - 12-11-2009, 07:42 AM
Question about tank_auth - by El Forum - 12-11-2009, 08:48 AM
Question about tank_auth - by El Forum - 12-11-2009, 11:45 AM
Question about tank_auth - by El Forum - 12-11-2009, 01:42 PM
Question about tank_auth - by El Forum - 12-14-2009, 03:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB