[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