Answer the question
In order to leave comments, you need to log in
Kohana 3.3. Auth does not authorize administrators, only users. Why?
Authorization of users with login rights is normal, but when trying to log in as a user with admin rights, no_user error "Does not exist login / password".
I found similar problems on the Internet, but they arose due to the fact that the wrong driver was specified in the configuration. I'm fine with the configuration, like:
<?php defined('SYSPATH') OR die('No direct access allowed.');
return array(
'driver' => 'ORM',
'hash_method' => 'sha256',
'hash_key' => '54l',
'lifetime' => 1209600,
'session_type' => Session::$default,
'session_key' => 'auth_user',
// Username/password combinations for the Auth File driver
'users' => array(
// 'admin' => 'b3154acf3a344170077d11bdb5fff31532f679a1919e716a02',
),
);
public function action_login() {
if (isset($_POST['submit'])){
$data = Arr::extract($_POST, array('username', 'password', 'remember'));
$status = Auth::instance()->login($data['username'], $data['password'], (bool) $data['remember']);
if ($status){
HTTP::redirect($settings->site_url, 302 );
}
else {
$errors = array(Kohana::message('auth/user', 'no_user'));
}
}
$this->template->content = View::factory('widgets/v_authorize')
->bind('errors', $errors);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question