I am trying to implement blowfish password hasher in my cakePHP app. I've followed along with the tutorial.
When trying to add a new user I'm getting a fatal error when I try to instantiate a new BlowfishPasswordHasher class in the beforeFilter function of my user model. The error states :Class 'BlowfishPasswordHasher' not found.
I saw the question here but it looks like I have everything setup correctly.
Here is relevant code in my app/Controller/appController:
class AppController extends Controller {
public $components = array(
'Flash',
'RequestHandler',
'Auth' => array(
'authenticate' => array(
'Form' =>array(
'passwordHasher' => 'Blowfish'
'fields' => array(
'username' => 'username',
'password' => 'password'
),
),
),
'loginRedirect' => '/trails',
'logoutRedirect' => '/',
),
);
app/Model/User.php
<?php
App::uses('AppModel', 'Model');
App::uses('BlowfishPasswordHasher', 'Conroller/Component/Auth');
class User extends AppModel {
public function beforeSave($options = array()) {
if (isset($this->data[$this->alias]['password'])) {
$passwordHasher = new BlowfishPasswordHasher();
$this->data[$this->alias]['password'] = $passwordHasher->hash($this->data[$this->alias]['password']
);
}
return true;
}
Any help is much appreciated!!!