Skip to content

Commit

Permalink
Merge pull request #8397 from hregis/7.0_bug3
Browse files Browse the repository at this point in the history
Fix: missing update of $conf
  • Loading branch information
eldy committed Mar 18, 2018
2 parents bbb095b + c0a6ae2 commit 0dd3344
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions htdocs/install/step5.php
Expand Up @@ -176,17 +176,19 @@
$sql = "SELECT u.rowid, u.pass, u.pass_crypted";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$resql=$db->query($sql);
if ($resql)
{
$numrows=$db->num_rows($resql);
if ($numrows == 0)
{
// Define default setup for password encryption
dolibarr_set_const($db, "DATABASE_PWD_ENCRYPTED", "1", 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_SECURITY_SALT", dol_print_date(dol_now(), 'dayhourlog'), 'chaine', 0, '', 0); // All entities
dolibarr_set_const($db, "MAIN_SECURITY_HASH_ALGO", 'sha1md5', 'chaine', 0, '', 0); // All entities
}
}
if ($resql)
{
$numrows=$db->num_rows($resql);
if ($numrows == 0)
{
// Define default setup for password encryption
dolibarr_set_const($db, "DATABASE_PWD_ENCRYPTED", "1", 'chaine', 0, '', $conf->entity); // Not All entities ?!
dolibarr_set_const($db, "MAIN_SECURITY_SALT", dol_print_date(dol_now(), 'dayhourlog'), 'chaine', 0, '', 0); // All entities
dolibarr_set_const($db, "MAIN_SECURITY_HASH_ALGO", 'sha1md5', 'chaine', 0, '', 0); // All entities

dolibarr_install_syslog('step5: DATABASE_PWD_ENCRYPTED = '.$conf->global->DATABASE_PWD_ENCRYPTED.' MAIN_SECURITY_HASH_ALGO = '.$conf->global->MAIN_SECURITY_HASH_ALGO, LOG_INFO);
}
}

// Create user used to create the admin user
$createuser=new User($db);
Expand Down

0 comments on commit 0dd3344

Please sign in to comment.