Welcome Guest, Not a member yet? Register   Sign In
MY_Controller and login-authentication misunderstanding probably
#6

[eluser]blitzneo[/eluser]
Hmmm I think I have it.. but..
having this:

<?php if ( ! defined(‘BASEPATH’)) exit(‘No direct script access allowed’);

class Auth_controller extends CI_Controller {

public function __construct()
{
parent::__construct();

if ($this->session->userdata(‘logged_in’) === TRUE)
{
//redirect(‘site/index’);
} else {
redirect(‘welcome/index’);
}
}
}

class Site extends Auth_controller {
public function index()
{
echo 'Logged';
}
}


if I type test.com/site/index, without logging in, it should redirect me to welcome/index, right ? Because it's not..


Messages In This Thread
MY_Controller and login-authentication misunderstanding probably - by El Forum - 06-07-2011, 01:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB