Rather than fighting the framework, why not use two non database
fields in your form - new_passwd and confirm_passwd. Validate these
fields if they are set in validates() - raising validation errors
($this->invalidate('new_passwd', 'error_msg'))  if they don't match/
too short/weak etc. Then (again) if new_passwd and confirm_passwd
fields are not empty, set the database passwd field to your hash in
beforeSave().

~GreyCells

On Apr 19, 9:31 pm, hepper <[EMAIL PROTECTED]> wrote:
> If some could explain hove to invalidate a field manual in the
> controller in 1.2.
> In 1.1 you could invalidate a field and then call save without
> parameters, then set wouldn't be called and the invalidated fields
> didn't get erased as nate explains 
> herehttp://groups.google.com/group/cake-php/browse_thread/thread/354a677b...
> But in 1.2 it changed so set() always will be called.
>
> I'm trying to create a user register action and if password =
> password2 then password will be transformed to a md5 hash.
> If the user name already registered then the password should be reset
> to the unhashed saved in a temp var.
>
> I know that I could invalidate in the beforeValidate() callback but I
> can't change the data back there (I think at least)
>
> Thankful for the help


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to