I am trying to set up a change password section.
password field and confirm field only.
model:
validation rules:
'password' => array(
'pass-notempty' => array(
'rule' => array('notempty'),
'required' => true,
'allowEmpty' => false,
'message' => 'Password cannot be empty.',
'last' => true),
'pass-length' => array(
'rule' => array('minLength', 8),
'message' => 'Password must be minimim 8 characters.',
'last' => true),
'pass-Similar' => array(
'rule' => 'checkPasswords',
'message' => 'Different password entered.',
'last' => true)
),
'confirm' => array(
'confirm-notempty' => array(
'rule' => array('notempty'),
'required' => true,
'allowEmpty' => false,
'message' => 'Pleae confirm your password.')
),
function checkPasswords()
{
if($this->data['User']['password'] == $this->data['User']['confirm'])
{
return true;
}
}
Now the password gets hashed automaticaly so I
$this->data['User']['confirm'] =
Security::hash($this->data['User']['confirm'], null, true);
in the controller but still same message..Do Not Match.
Am i missing something? I unbind the other validation in the model so its
not checking anything other than password and confirm
Thanks
Dave
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---