Re: Recursive decrypt
Yes. So, any hit, how can with cipher behavior solve this thing? Or I must do this manual? On 3 dec., 21:17, Joel Perras <[EMAIL PROTECTED]> wrote: > If you mean on the behaviors of associated models, then > no.https://trac.cakephp.org/ticket/2056 > > -J. > > On Dec 3, 9:00 am, Andraž <[EMAIL PROTECTED]> wrote: > > > Does cake trigger callbacks on associated models? > > > On 3 dec., 10:56, Andraž <[EMAIL PROTECTED]> wrote: > > > > Any hint? > > > > On 2 dec., 23:31, Andraž <[EMAIL PROTECTED]> wrote: > > > > > Hello! > > > > > I'm playing with Cipher behavior (http://bakery.cakephp.org/articles/ > > > > view/cipher-behavior), but I have problems with recursive decrypt. > > > > > What I must change in this function, that will work with recursive > > > > also? > > > > > /** Model hook to decrypt model data if auto decipher is turned on in > > > > the > > > > * model behavior configuration. Only primary model data are > > > > decrypted. */ > > > > function afterFind(&$model, $result, $primary = false) { > > > > if (!$result || !isset($this->config[$model->name]['cipher'])) > > > > return $result; > > > > > if ($primary && $this->config[$model->name]['autoDecrypt']) { > > > > // check for single of multiple model > > > > $keys = array_keys($result); > > > > if (!is_numeric($keys[0])) { > > > > $this->decrypt(&$model, &$result); > > > > } else { > > > > foreach($keys as $index) { > > > > $this->decrypt(&$model, &$result[$index]); > > > > } > > > > } > > > > } > > > > return $result; > > > > } > > > > > Regards Andraz - Open source specialist > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Recursive decrypt
If you mean on the behaviors of associated models, then no. https://trac.cakephp.org/ticket/2056 -J. On Dec 3, 9:00 am, Andraž <[EMAIL PROTECTED]> wrote: > Does cake trigger callbacks on associated models? > > On 3 dec., 10:56, Andraž <[EMAIL PROTECTED]> wrote: > > > Any hint? > > > On 2 dec., 23:31, Andraž <[EMAIL PROTECTED]> wrote: > > > > Hello! > > > > I'm playing with Cipher behavior (http://bakery.cakephp.org/articles/ > > > view/cipher-behavior), but I have problems with recursive decrypt. > > > > What I must change in this function, that will work with recursive > > > also? > > > > /** Model hook to decrypt model data if auto decipher is turned on in > > > the > > > * model behavior configuration. Only primary model data are > > > decrypted. */ > > > function afterFind(&$model, $result, $primary = false) { > > > if (!$result || !isset($this->config[$model->name]['cipher'])) > > > return $result; > > > > if ($primary && $this->config[$model->name]['autoDecrypt']) { > > > // check for single of multiple model > > > $keys = array_keys($result); > > > if (!is_numeric($keys[0])) { > > > $this->decrypt(&$model, &$result); > > > } else { > > > foreach($keys as $index) { > > > $this->decrypt(&$model, &$result[$index]); > > > } > > > } > > > } > > > return $result; > > > } > > > > Regards Andraz - Open source specialist --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Recursive decrypt
Does cake trigger callbacks on associated models? On 3 dec., 10:56, Andraž <[EMAIL PROTECTED]> wrote: > Any hint? > > On 2 dec., 23:31, Andraž <[EMAIL PROTECTED]> wrote: > > > Hello! > > > I'm playing with Cipher behavior (http://bakery.cakephp.org/articles/ > > view/cipher-behavior), but I have problems with recursive decrypt. > > > What I must change in this function, that will work with recursive > > also? > > > /** Model hook to decrypt model data if auto decipher is turned on in > > the > > * model behavior configuration. Only primary model data are > > decrypted. */ > > function afterFind(&$model, $result, $primary = false) { > > if (!$result || !isset($this->config[$model->name]['cipher'])) > > return $result; > > > if ($primary && $this->config[$model->name]['autoDecrypt']) { > > // check for single of multiple model > > $keys = array_keys($result); > > if (!is_numeric($keys[0])) { > > $this->decrypt(&$model, &$result); > > } else { > > foreach($keys as $index) { > > $this->decrypt(&$model, &$result[$index]); > > } > > } > > } > > return $result; > > } > > > Regards Andraz - Open source specialist > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Recursive decrypt
Any hint? On 2 dec., 23:31, Andraž <[EMAIL PROTECTED]> wrote: > Hello! > > I'm playing with Cipher behavior (http://bakery.cakephp.org/articles/ > view/cipher-behavior), but I have problems with recursive decrypt. > > What I must change in this function, that will work with recursive > also? > > /** Model hook to decrypt model data if auto decipher is turned on in > the > * model behavior configuration. Only primary model data are > decrypted. */ > function afterFind(&$model, $result, $primary = false) { > if (!$result || !isset($this->config[$model->name]['cipher'])) > return $result; > > if ($primary && $this->config[$model->name]['autoDecrypt']) { > // check for single of multiple model > $keys = array_keys($result); > if (!is_numeric($keys[0])) { > $this->decrypt(&$model, &$result); > } else { > foreach($keys as $index) { > $this->decrypt(&$model, &$result[$index]); > } > } > } > return $result; > } > > Regards Andraz - Open source specialist --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Recursive decrypt
Hello! I'm playing with Cipher behavior (http://bakery.cakephp.org/articles/ view/cipher-behavior), but I have problems with recursive decrypt. What I must change in this function, that will work with recursive also? /** Model hook to decrypt model data if auto decipher is turned on in the * model behavior configuration. Only primary model data are decrypted. */ function afterFind(&$model, $result, $primary = false) { if (!$result || !isset($this->config[$model->name]['cipher'])) return $result; if ($primary && $this->config[$model->name]['autoDecrypt']) { // check for single of multiple model $keys = array_keys($result); if (!is_numeric($keys[0])) { $this->decrypt(&$model, &$result); } else { foreach($keys as $index) { $this->decrypt(&$model, &$result[$index]); } } } return $result; } Regards Andraz - Open source specialist --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---