21298 Posts in 5735 Topics by 2603 members
| Go to End | ||
| Author | Topic: | 1482 Views |
-
Re: Encrypting Data using OnBeforeWrite

4 May 2012 at 2:01pm
I use it in Model Admin as well I just add the following function to my object
http://pastie.org/3856863Then all you have to do is create a custom getter for the value to decrypt it. For instance if you encypted a field called FirstName just create:
protected function getFirstName() {
$toDecrypt = $this->getField("FirstName");
/* Decrypt encrypted string */
$decrypted = $this->decryptInfo($toDecrypt);
return $decrypted;
}This is good because if you need to call FirstName in a FrontEnd template it will work as well
-
Re: Encrypting Data using OnBeforeWrite

4 May 2012 at 9:27pm
You sir are a star.....
Got it working although not on the memberextension decorator but that will hopefully just be a small tweak but got it working on a standard dataobject.
Thanks again for your help and patience.
Mick
| 1482 Views | ||
| Go to Top |


