I was trying to work with Cake PHP Auth Section in cake tutorials with my project. But it doesn't work.
I have created three tables 'admin_users' with fields(id,username,password,group_id,created,modified) , 'admin_groups'(id,name,created, modified) and 'users'(id,username,password,created,modified);
I tried normal users will be put in users table and admin users are in 'admin_users' table and grouped the admin users by 'admin_groups' for permission acess in admin side.
When I try to path '[rootpath]/users/login' gives an error Database table 'admins' for model Admin was not found. But I dont created a model for admin.
After I maually created the admins table again error "Database table 'users_admin' for model UsersAdmin was not found". Here also dont created a model for UsersAdmin.
In Users Controller
class UsersController extends AppController {
var $name = 'Users';
var $uses = array();
var $components = array('Auth','Session');
function login() {
$this->set('title_for_layout', 'Login');
/*if ($this->Auth->user()) {
$this->redirect($this->Auth->redirect());
}*/
}
function logout() {
$this->redirect($this->Auth->logout());
}
}