class Auth_Controller extends Home_Controller { public function __construct() { parent::__construct(); $this-> session = Session:: instance(); $this-> auth = Auth :: instance(); } public function index() { } public function login() { if ($this->auth->logged_in()) { url::redirect($this->session->get("requested_url")); } else { if ($this->auth->logged_in()){ }else{ //$template->title="Please Login"; $this->template = new View('template'); $this->template->tresc= new View('login'); $this->template->render(TRUE); } } } public function login2() { $username = $this->input->post('username'); $password = $this->input->post('password'); $user = ORM::factory('user', $username); Auth::instance()->login($user->username, $password); if ($this->auth->logged_in()) else } }
class Home_Controller extends Controller { public $template; public $session; public $auth; public function __construct() { parent::__construct(); } public function index() { $this->template = new View('template'); $this->template->tresc = new View('glowna/index'); $this->template->render(TRUE); } }
Czy mógłby ktoś na to spojrzeć? Po logowaniu ten fragment
Ciągle zwraca 5, czyli chyba user nie jest zalogowany? Co robię źle że nie chce logować?
if ($this->auth->logged_in()) else
Dzięki za pomoc.
Jakby była potrzeba pokazać pliki widoków to napiszcie .