You can tell cake 1.2 to only apply rules under certain circumstances.
Have a look at 
http://lemoncake.wordpress.com/2007/07/03/all-about-validation-in-cakephp-12/
for more on this. In particular the code under the "Construct 2:
Single Rule per field" heading where there is the ability to define
when a rule should be applied (on create, on update).

Ianh

On Aug 30, 7:36 am, Al PropNut <[EMAIL PROTECTED]> wrote:
> Using v1.2.xxx, I'm trying to figure out how to manage password edits.
> Currently, I have password validation set as VALID_NOT_EMPTY. That
> works fine when I add a record.
>
> But for edits, I want to:
> 1) Display the form with an empty password.
> 2) Only write the new password if the password post var is not empty.
> 3) MD5 encrypt the password before saving
>
> Here's what I'm thinking:
> 1) Remove password validation from the model and do it manually in the
> controller.
> 2) If the password post var is null, pass a fields array to the save
> method leaving out the password.
> 3) If the password post var is not null, MD5 encrypt and save
> normally.
>
> Any suggestions, examples, or tutorials would be greatly appreciated.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to