Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // AppController.php
- public $components = array(
- 'Session',
- 'Auth' => array(
- 'authenticate' => array(
- 'Blowfish' => array(
- 'scope' => array('User.is_active' => true)
- )
- ),
- 'loginRedirect' => array('controller' => 'pages', 'action' => 'home'),
- 'logoutRedirect' => array('controller' => 'pages', 'action' => 'home')
- )
- );
- // UsersController.php
- public function login() {
- if($this->request->is('post')) {
- if($this->Auth->login()) {
- $this->redirect($this->Auth->redirect());
- } else {
- $this->Session->setFlash('Invalid username or password, try again.');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement