From 98c92337f1832d7cc9b9ffd9e36fbf47b6a7351e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 12 Nov 2024 13:46:13 +0100 Subject: [PATCH] Update security.php (#31777) Co-authored-by: Laurent Destailleur --- htdocs/admin/security.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 83622f5b80c19..c28c4deaa5668 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -1,8 +1,8 @@ - * Copyright (C) 2005-2007 Regis Houssin - * Copyright (C) 2013-2015 Juanjo Menent - * Copyright (C) 2024 MDW +/* Copyright (C) 2004-2022 Laurent Destailleur + * Copyright (C) 2005-2007 Regis Houssin + * Copyright (C) 2013-2015 Juanjo Menent + * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -114,8 +114,10 @@ } } elseif ($action == 'disable_encrypt') { // By default, $allow_disable_encryption is false we do not allow to disable encryption because passwords can't be decoded once encrypted. + // We set entity=0 (all) because DATABASE_PWD_ENCRYPTED is a setup into conf file, so always shared for everybody if ($allow_disable_encryption) { dolibarr_del_const($db, "DATABASE_PWD_ENCRYPTED", $conf->entity); + dolibarr_del_const($db, "DATABASE_PWD_ENCRYPTED", 0); } } @@ -125,7 +127,7 @@ sleep(3); // Don't know why but we need to wait file is completely saved before making the reload. Even with flush and clearstatcache, we need to wait. // database value not required - //dolibarr_set_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED", "1"); + // dolibarr_set_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED", "1"); header("Location: security.php"); exit; } else { @@ -137,11 +139,11 @@ sleep(3); // Don't know why but we need to wait file is completely saved before making the reload. Even with flush and clearstatcache, we need to wait. // database value not required - //dolibarr_del_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED",$conf->entity); + // dolibarr_del_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED",$conf->entity); header("Location: security.php"); exit; } else { - //setEventMessages($langs->trans('InstrucToClearPass', $dolibarr_main_db_pass), null, 'warnings'); + // setEventMessages($langs->trans('InstrucToClearPass', $dolibarr_main_db_pass), null, 'warnings'); setEventMessages($langs->trans('InstrucToClearPass', $langs->transnoentitiesnoconv("DatabasePassword")), null, 'warnings'); } }