This topic is locked

Custom function for Edit Page

4/1/2010 11:08:11 AM
PHPRunner General questions
J
jacekq author

Hello,
I've got some fields/columns in a table that are encrypted with a specific, custom function.

On the PHPR edit page, before edition, I must decrypt their values because they are unreadeable for a human.

What event function (and how) should be used to achieve this?
After changes, I must encrypt their values but it is very easy with the BeforeEdit event.
Regards,

Jacek

J
jacekq author 4/2/2010

Hello,
The only solution I've found by now is to modify the script file '##TABLE##_edit.php'.

I must change a given lines from (an example):

$control_crypt_name["params"]["value"]=@$data["crypt_name"];



to:

$control_crypt_name["params"]["value"]= $my_crypt->endecrypt('', substr(@$data["crypt_name"], 1), 'de');


where:

$my_crypt->endecrypt is a custom method from a cryptography class...
It's not a nice solution because every time I compile PHPR Project I have additional hand work...
Regards,

Jacek

Sergey Kornilov admin 4/2/2010

Jacek,
unfortunately right now we do have events that can help you with this. We'll add something for this purpose in the next version.