Skip to content

Commit

Permalink
Update security.php (#31777)
Browse files Browse the repository at this point in the history
Co-authored-by: Laurent Destailleur <[email protected]>
  • Loading branch information
frederic34 and eldy authored Nov 12, 2024
1 parent 542b4bd commit 98c9233
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions htdocs/admin/security.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2004-2022 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2007 Regis Houssin <[email protected]>
* Copyright (C) 2013-2015 Juanjo Menent <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
/* Copyright (C) 2004-2022 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2007 Regis Houssin <[email protected]>
* Copyright (C) 2013-2015 Juanjo Menent <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -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);
}
}

Expand All @@ -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 {
Expand All @@ -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');
}
}
Expand Down

0 comments on commit 98c9233

Please sign in to comment.