From a2d7c0efd2e137cd67617c6d840a16d363672bec Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 4 Jul 2009 12:52:40 +0000 Subject: [PATCH] Experimental: add function to encrypt sensitive data in database --- htdocs/install/inc.php | 4 ++++ htdocs/install/upgrade2.php | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 283d9d62d81..6d935684aca 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -218,6 +218,10 @@ function conf($dolibarr_main_document_root) $conf->db->character_set=$dolibarr_main_db_charset; if (empty($dolibarr_main_db_collation)) $dolibarr_main_db_collation='latin1_swedish_ci'; $conf->db->dolibarr_main_db_collation=$dolibarr_main_db_collation; + if (empty($dolibarr_main_db_encryption)) $dolibarr_main_db_encryption=0; + $conf->db->dolibarr_main_db_encryption = $dolibarr_main_db_encryption; + if (empty($dolibarr_main_db_cryptkey)) $dolibarr_main_db_cryptkey=''; + $conf->db->dolibarr_main_db_cryptkey = $dolibarr_main_db_cryptkey; // Forcage du log pour les install et mises a jour $conf->syslog->enabled=1; diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 6e1ac9411bc..aac7c468253 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -109,6 +109,11 @@ if (isset($_POST['action']) && $_POST['action'] == 'upgrade') } } + if (empty($dolibarr_main_db_encryption)) $dolibarr_main_db_encryption=0; + $conf->db->dolibarr_main_db_encryption = $dolibarr_main_db_encryption; + if (empty($dolibarr_main_db_cryptkey)) $dolibarr_main_db_cryptkey=''; + $conf->db->dolibarr_main_db_cryptkey = $dolibarr_main_db_cryptkey; + // Chargement config if (! $error) $conf->setValues($db);