Merge pull request #7396 from tuxgasy/5.0_bug7386
Fix #7386 : Decode DB password on upgrade
This commit is contained in:
commit
5d068083e5
@ -308,6 +308,18 @@ else
|
|||||||
{
|
{
|
||||||
require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php';
|
require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php';
|
||||||
|
|
||||||
|
// If password is encoded, we decode it
|
||||||
|
if (preg_match('/crypted:/i',$dolibarr_main_db_pass) || ! empty($dolibarr_main_db_encrypted_pass))
|
||||||
|
{
|
||||||
|
require_once $dolibarr_main_document_root.'/core/lib/security.lib.php';
|
||||||
|
if (preg_match('/crypted:/i',$dolibarr_main_db_pass))
|
||||||
|
{
|
||||||
|
$dolibarr_main_db_encrypted_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass); // We need to set this as it is used to know the password was initially crypted
|
||||||
|
$dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
|
||||||
|
}
|
||||||
|
else $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
|
||||||
|
}
|
||||||
|
|
||||||
// $conf is already instancied inside inc.php
|
// $conf is already instancied inside inc.php
|
||||||
$conf->db->type = $dolibarr_main_db_type;
|
$conf->db->type = $dolibarr_main_db_type;
|
||||||
$conf->db->host = $dolibarr_main_db_host;
|
$conf->db->host = $dolibarr_main_db_host;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user