cakephp-2.4

CakePHP - How do I implement blowfish hashing for passwords?

痞子三分冷 提交于 2019-11-29 07:35:44
Struggling to find answers to a few basic questions about using Blowfish in Cake 2.4. AppController.php public $components = array( 'Auth' => array( 'authenticate' => array( 'Form' => array( 'fields' => array( 'username' => 'email' ), 'passwordHasher' => 'Blowfish' ) ) ), 'Cookie', 'Session' ); What now? How do I log in? UsersController.php public function login() { if (!empty($this->request->data)) { if ($this->Auth->login()) { $this->redirect($this->Auth->redirectUrl()); } } } What do I need to add to this? I'm getting the following error if I try to log in: Warning (512): Invalid salt: for

CakePHP - How do I implement blowfish hashing for passwords?

删除回忆录丶 提交于 2019-11-28 01:17:05
问题 Struggling to find answers to a few basic questions about using Blowfish in Cake 2.4. AppController.php public $components = array( 'Auth' => array( 'authenticate' => array( 'Form' => array( 'fields' => array( 'username' => 'email' ), 'passwordHasher' => 'Blowfish' ) ) ), 'Cookie', 'Session' ); What now? How do I log in? UsersController.php public function login() { if (!empty($this->request->data)) { if ($this->Auth->login()) { $this->redirect($this->Auth->redirectUrl()); } } } What do I

CakePHP does not use my models

馋奶兔 提交于 2019-11-26 17:52:17
I have got these two CakePHP V 2.4.5 models: class Owner extends AppModel { public $name = 'Owner'; public $hasMany = array('Car'); } and class Car extends AppModel { public $name = 'Car'; public $belongsTo = array('Owner'); } in my controller I wrote: var $uses = array('Owner', 'Car'); public function test(){ $data = array( 'Owner' => array( 'name' => 'Me' ), 'Car' => array( array('color' => 'red'), array('color' => 'blue') ) ); $this->Owner->saveAssociated($data, array('deep' => true)); } But CakePHP created the owner and forgets to create his cars: 1 BEGIN 2 INSERT INTO `test`.`owners` (