Kohana 3: Auth module
Posted
by Thomas
on Stack Overflow
See other posts from Stack Overflow
or by Thomas
Published on 2010-06-09T18:54:06Z
Indexed on
2010/06/10
18:52 UTC
Read the original article
Hit count: 678
Hi, i'm trying to learn the Kohana's Auth module but login method always return false.
Controller:
<?php defined('SYSPATH') OR die('No Direct Script Access');
class Controller_Auth extends Controller {
public function action_index() {
if($_POST) {
$this->login();
}
$this->template = View::factory('login');
echo $this->template;
}
private function login() {
$user = ORM::factory('user');
$data = array('username' => 'wilson', 'password' => '123');
if(!$user->login($data)) {
echo 'FAILED!';
}
}
private function logout() {
}
}
?>
Model:
<?php defined('SYSPATH') or die('No direct script access.');
class Model_User extends Model_Auth_User {
}
?>
© Stack Overflow or respective owner