Hello All,
I have a tabel with data in it.
i have created a form that store's the data, its working fine.
now i want to encrypt the saved data only on 1 textfield.
is this possible and how can i do it?
Hello All,
I have a tabel with data in it.
i have created a form that store's the data, its working fine.
now i want to encrypt the saved data only on 1 textfield.
is this possible and how can i do it?
Use a HOOK before values are saved and use the class Encryption in
system/modules/core/library/Contao/Encryption.php
e.g.
PHP Code:
\Encryption::encrypt($myVar)
Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
Amazon wishlist
Thanks for the replay,
I have made a hook and add it to my config file,
When i create a autoload (backend autoload creator) the class is not be saved in my autoload.
The hook in config/config.php :
and the class in classes/encrypt_form_data.php is :Code:$GLOBALS['TL_HOOKS']['prepareFormData'][] = array('encrypt_form_data', 'MyEncryptFormData');
When i add it in autoload.php See code below i get a error Cannot redeclare classCode:<?php if (!defined('TL_ROOT')) die('You can not access this file directly!'); class MyEncryptFormData { public function EncryptFormData($arrSubmitted, $arrLabels, $objForm) { if (isset($arrSubmitted['dossier'])){ $arrSubmitted['dossier'] = Encryption::encrypt($arrSubmitted['dossier']); } } }
Code:'encrypt_form_data' => 'system/modules/inbalans/classes/encrypt_form_data.php',
Last edited by Notify; 10/28/2015 at 11:21.
First build an extension with the extension creator from within back end. Then take a look at the config files. It should be self-explanatory.
Web-Development, Freelancer, Burgtech, XHTML, HTML5, CSS, PHP, Javascript, MooTools, MySQL and more
Amazon wishlist
Thanks, The problem is solved.
My class was a different name then the file so it wassend loading.
Bookmarks