This part of the problem has been solved.
On 29 jan, 20:41, Delirium tremens <pedbe...@gmail.com> wrote:
> The following code does not work.
>
> function hashPasswords($data) {
> return $data;
> }
> function beforeSave() {
> $this->data['Account']['password'] = Security::hash($this->data
> ['Account']['password'], null, true);
> return true;
> }
>
> Can you figure out why?
>
> On 29 jan, 19:51, Delirium tremens <pedbe...@gmail.com> wrote:
>
> > function hashPasswords($data, $enforce=false) {
> > if($enforce && isset($data['Account']['password'])) {
> > if(!empty($data['Account']['password'])) {
> > $data['Account']['password'] = Security::hash($data
> > ['Account']['password'], null, true);
> > }
> > }
> > $this->data = $data;
> > pr($this->data);
> > return $data;
> > }
> > function beforeSave() {
> > $data = $this->data;
> > pr($data);
> > $this->hashPasswords($data, true);
> > return true;
> > }
>
> > The first pr prints an array with email and password (hashPasswords is
> > called twice, it should print an unencrypted password, then print an
> > encrypted password). The second pr does not print anything. How to
> > solve this problem?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---