I have two types of users and right now i dont want to use ACL. With Auth Component i want to achieve the following
login() -> allows users to login and access the general part of the site admin_login -> allows the admin to access the admin_{actions} part of the website.
When i do a Admin Login -> i want to check if group_id = 1 in the Users Module and only allow them to login to the admin section of the website.
function admin_login(){
$this->layout = 'admin_login';
if($this->request->is('post')) {
if($this->Auth->login()) {
$this->redirect($this->Auth->redirect());
} else {
$this->Session->setFlash(__('Invalid username and password, try again'));
}
}
}
How to check if the group_id = 1 when the user logs in ?