Wednesday, July 27, 2011

Re: CakePHP 2.0 Auth

or simply use a behavior:
https://github.com/dereuromark/tools/blob/master/models/behaviors/change_password.php

this is still cake1.3 though :)


On 27 Jul., 04:18, "Meroe Kush" <whme...@gmail.com> wrote:
> Disregard my last post please.....
>
> As soon as I hit send I found this:
>
> Hashing passwords
>
> AuthComponent no longer automatically hashes every password it can find.
> This was removed because it made a number of common tasks like validation
> difficult. You should never store plain text passwords, and before saving a
> user record you should always hash the password. You can use the static
> AuthComponent::password() to hash passwords before saving them. This will
> use the configured hashing strategy for your application.
>
> After validating the password, you can hash a password in the beforeSave
> callback of your model:
>
> <?php
>
> class User extends AppModel {
>
>     function beforeSave($options = array()) {
>
>         $this->data['User']['password'] =
> AuthComponent::password($this->data['User']['password']);
>
>         return true;
>
>     }
>
>
>
>
>
>
>
> }

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate