Hey guys, I'm working on a cakephp app that manages a list of alpha users. It's a simple form that accepts a name and email and then generates an alpha code after submission, that alpha code is then stored in the record with the name and email under the column "code." I'm using a component calleed PasswordHelper which is located here
Here' my code
class AlphaUsersController extends AppController {
var $name = 'AlphaUsers';
var $components = array('PasswordHelper');
function add() {
if(!empty($this->data)) {
if($this->AlphaUser->save($this->data)){
$this->AlphaUser->set('code', generatePassword(10));
$this->AlphaUser->save();
$this->Session->setFlash('User has been added.');
$this->redirect(array('action' => 'index'));
}
}
}
}
The form data saves just fine when I don't include the alpha code lines, but when I try to generate the password, I get this error.
Fatal error: Call to undefined function generatepassword() in /Users/Warren/Sites/caroverload/app/controllers/alpha_users_controller.php on line 22
What's going on here? I have the PasswordHelper file saved in the appropriate components directory and it's added in the components array for this controller.