Skip to content

Instantly share code, notes, and snippets.

@patrickmaciel
Created January 7, 2012 20:29
Show Gist options
  • Save patrickmaciel/1575947 to your computer and use it in GitHub Desktop.
Save patrickmaciel/1575947 to your computer and use it in GitHub Desktop.
Autenticação do usuário - pt-br - CakePHP 2.05
<?php
App::uses('Controller', 'Controller');
class AppController extends Controller {
public $helpers = array();
public $components = array(
'Session',
'Acl',
'Auth' => array(
'Actions' => array('actionPath' => 'controllers'), // está correto aqui?
'authenticate' => array(
'Form' => array(
'fields' => array('username' => 'usuario', 'password' => 'senha'),
'userModel' => 'Usuario'
)
),
'loginAction' => array('controller' => 'usuarios', 'action' => 'login'),
'logoutAction' => array('controller' => 'usuarios', 'action' => 'logout'),
'authError' => 'Você não tem permissão para acessar esta página.',
'authorize' => array('Controller')
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment