
Untitled
By: a guest on
Jun 17th, 2012 | syntax:
None | size: 0.63 KB | hits: 20 | expires: Never
CakePHP autentication with auth table other than User problem
class AppController extends Controller {
var $components = array('Auth', 'Session', 'Cookie', 'P28n');
function beforeFilter() {
$this->Auth->authenticate = ClassRegistry::init('Reviewer');
Security::setHash('sha1'); // or sha1 or sha256
$this->Auth->userModel = 'Reviewers';
$this->Auth->fields = array('username' => 'username', 'password'=>'password');
$this->Auth->loginRedirect = array('controller' => 'reviewers', 'action' => 'view');
}
$this->data['User']['password'] = Security::hash($this->data['User']['password']);