mononeuronaorg **/ class AppController extends Controller { public $components = array('Auth', 'Cookie', 'Security'); public $helpers = array('Html', 'Form', 'Session'); public function beforeFilter() { $this->Auth->fields = array('username' => 'email', 'password' => 'pwd'); $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login'); $this->Auth->loginRedirect = array('controller' => 'entries', 'action' => 'display'); $this->Auth->logoutRedirect = '/entries/display'; $this->Auth->loginError = 'Invalid e-mail / password combination. Please try again'; $this->Auth->authorize = 'controller'; $this->Auth->deny('*'); $this->Auth->autoRedirect = true; $this->set('cU', $this->Auth->user()); // $cU current user array to use in the views if user logged } } ?>