Yep,

Use a different field, eg. new_password or something. (I'm assuming
you're validating when creating a password. No need for login)

Here's assuming you have a model called User:

// needed for validation for some reason
$this->User->set($this->data);
if ($this->validates($this->data))
{
    $this->data['User']['passwd'] =
$this->Auth->password($this->data['User']['new_passwd'] )

    // all we did was hash passwords, no need to revalidate.
    if ($this->save($this->data, false))
    {
        //    do stuff
    } else
    {
        // invalid
    }
}

Would be nice to stick this is beforeSave in the model, but you can't
[easily] access the Auth component from the model.

Hope this helps.


On Jan 17, 2008 9:31 AM, dizz <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I am using the auth component and before my model can validate the
> password the auth component already encrypts the password so making it
> impossible to use the between built in valid method.
>
> Is there any work around for this?
> >
>

--~--~---------~--~----~------------~-------~--~----~
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