Im having a problem with the $fieldList parameter for my User model's
save() method:
(in users_controller)
$this->data['User']['password_confirm_hashed'] = $this->Auth->password
($this->data['User']['confirm_password']);
$fieldList = array(
'first_name',
'last_name',
'email',
'password',
'password_confirm',
'password_confirm_hashed',
);
if ($this->User->save($this->data, true, $fieldList)) {
$this->__sendActivationEmail($this->User->getLastInsertID());
$this->redirect('/thank_you');
}
I use the fieldList for the save() method to limit the save to the
actual fields being asked for in the signup process, to avoid the user
from adding values to other fields by modifying the form (for example
there is a "activated" field in the users table, that indicated that
the user has clicked the activation link in an email he receives after
signup).
My problem: As soon as I add the "true" for validation and $fieldList
array to the save method, then the password_confirm check is no longer
applied! I know the password confirm check works just fine, because
the simply running $this->User->save($this->data) works like a charm.
As soon as I run $this->User->save($this->data, true, $fieldList) then
the validation for confirm_password (and only for that, not for the
other fields) is ignored!
Why does that happen?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---