Skip to content
Snippets Groups Projects
Commit 45028de5 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Better fix for install on distant server

parent c16489a3
No related branches found
No related tags found
No related merge requests found
...@@ -541,16 +541,20 @@ if (! $error && $db->connected && $action == "set") ...@@ -541,16 +541,20 @@ if (! $error && $db->connected && $action == "set")
{ {
if ($db->connected) if ($db->connected)
{ {
$resultbis = 1;
// Create user // Create user
$tmpdolibarr_main_db_host = $dolibarr_main_db_host; $result=$db->DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name);
// Create user bis
if ($databasefortest == 'mysql') if ($databasefortest == 'mysql')
{ {
if (! in_array($conf->db->host, array('127.0.0.1', 'localhost', 'localhost.local'))) $tmpdolibarr_main_db_host='%'; if (! in_array($dolibarr_main_db_host, array('127.0.0.1', '::1', 'localhost', 'localhost.local')))
{
$resultbis=$db->DDLCreateUser('%', $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name);
}
} }
$result=$db->DDLCreateUser($tmpdolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name); if ($result > 0 && $resultbis > 0)
if ($result > 0)
{ {
print '<tr><td>'; print '<tr><td>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment