Umbraco Forms (v7) - Encrypt and decrypt form variables
I'm trying to encrypt Umbraco Forms values stored the database, and decrypt them when viewing in the backoffice and exporting.
The encryption part can take place in the workflow used, but I can't find a location to override or change to decrypt the values.
This topic shows which steps to take to encrypt and decrypt, but the DataTables_json.xslt doensn`t seem to be used anymore in the V7 version of Umbraco Forms. Does anyone know which logic I need to override / change to get the decryption to work?
Ps. there also doensn`t seem to be an event to execute after saving the records to the database, only before: RecordStorage.RecordInserting. The after event could be used to always encrypt instead of defined per workflow.
I tried to update the values in the RecordInserting event, but they don't seem to be used in the save function:
void RecordStorage_RecordInserting(object sender, Umbraco.Forms.Core.RecordEventArgs e)
{
foreach (var record in e.Record.RecordFields)
{
record.Value.Values = new List<object>() { Security.Encrypt(record.Value.Values.FirstOrDefault().ToString(), "key") };
};
}
Maybe too late for you, but I've found how to make this work. After modifying any field values, you have to rebuild the JSON representation of the record data:
Umbraco Forms (v7) - Encrypt and decrypt form variables
I'm trying to encrypt Umbraco Forms values stored the database, and decrypt them when viewing in the backoffice and exporting.
The encryption part can take place in the workflow used, but I can't find a location to override or change to decrypt the values.
This topic shows which steps to take to encrypt and decrypt, but the DataTables_json.xslt doensn`t seem to be used anymore in the V7 version of Umbraco Forms. Does anyone know which logic I need to override / change to get the decryption to work?
Ps. there also doensn`t seem to be an event to execute after saving the records to the database, only before: RecordStorage.RecordInserting. The after event could be used to always encrypt instead of defined per workflow.
I tried to update the values in the RecordInserting event, but they don't seem to be used in the save function:
Maybe too late for you, but I've found how to make this work. After modifying any field values, you have to rebuild the JSON representation of the record data:
or in your case:
is working on a reply...