In my Mysql database I have some data that I encrypted for privacy reasons.
But I want to be able to see the decrypted data with MATE in order to edit it.
- Code: Select all
$tableColumns['sensitive_data'] = array(
'display_text' => 'Sensitive Data',
'perms' => 'EVTAXQSFHO',
'table_fun' => array(&$this,'textDecrypt')
);
And here is the code of the function (just before "protected function initiateEditor()" )
- Code: Select all
function textDecrypt($col,$val,$row)
{
$html = '';
if (isset($val) && strlen($val) > 0)
{
$html = $cryptor->decrypt($val);
}
return $html;
}
The problem is I get this error :
Invalid json sent back from server. Error: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Server sent: Fatal error: Uncaught Error: Call to a member function decrypt() on null
Does someone understands why ?
--