Так что это такое 'username'? Имя поля, форма, логин?
Можно, как вы спрашиваете, только если вот так $auth->login('admin','123'), где admin - логин, а 123 - пароль.
Код:
public function action_signin()
{
$content = View::factory('sign/signin')->bind('errors', $this->errors);
// check request method
if ($this->request->method() === Request::POST)
{
// validate
$post = Validation::factory($_POST)
->rule('username','not_empty')
->rule('password','not_empty');
if ($post->check())
{
//echo Debug::vars($post['password']);exit;
$status = $this->_auth->login($post['username'], $post['password']);
// if logins OK
if ($status)
{
// if destination key exists
$redirect = $this->_session->get('destination') ? $this->_session->get('destination') : NULL;
if (! is_null($redirect))
{
// delete destinaion session data
$this->_session->delete('destination');
// redirect to destination
$this->request->redirect($redirect);
}
$this->request->redirect('/');
}
else
{
$this->errors[] = 'Неверный логин или пароль!';
$content->bind('username', $_POST['username']);
}
}
else
{
$this->errors = $post->errors('models/user', TRUE);
}
}
$this->template->title = 'Авторизация';
$this->template->content = $content;
}