Fix: If user already exists but permissions not set, it was not possible
to install Dolibarr.
This commit is contained in:
parent
95d8161dc1
commit
300e430024
@ -1079,8 +1079,16 @@ class DoliDBMysql extends DoliDB
|
|||||||
$resql=$this->query($sql);
|
$resql=$this->query($sql);
|
||||||
if (! $resql)
|
if (! $resql)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
|
if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS')
|
||||||
return -1;
|
{
|
||||||
|
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// If user already exists, we continue to set permissions
|
||||||
|
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$sql = "GRANT ALL PRIVILEGES ON ".$this->escape($dolibarr_main_db_name).".* TO '".$this->escape($dolibarr_main_db_user)."'@'".$this->escape($dolibarr_main_db_host)."' IDENTIFIED BY '".$this->escape($dolibarr_main_db_pass)."'";
|
$sql = "GRANT ALL PRIVILEGES ON ".$this->escape($dolibarr_main_db_name).".* TO '".$this->escape($dolibarr_main_db_user)."'@'".$this->escape($dolibarr_main_db_host)."' IDENTIFIED BY '".$this->escape($dolibarr_main_db_pass)."'";
|
||||||
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log
|
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log
|
||||||
|
|||||||
@ -1073,8 +1073,16 @@ class DoliDBMysqli extends DoliDB
|
|||||||
$resql=$this->query($sql);
|
$resql=$this->query($sql);
|
||||||
if (! $resql)
|
if (! $resql)
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
|
if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS')
|
||||||
return -1;
|
{
|
||||||
|
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// If user already exists, we continue to set permissions
|
||||||
|
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$sql = "GRANT ALL PRIVILEGES ON ".$this->escape($dolibarr_main_db_name).".* TO '".$this->escape($dolibarr_main_db_user)."'@'".$this->escape($dolibarr_main_db_host)."' IDENTIFIED BY '".$this->escape($dolibarr_main_db_pass)."'";
|
$sql = "GRANT ALL PRIVILEGES ON ".$this->escape($dolibarr_main_db_name).".* TO '".$this->escape($dolibarr_main_db_user)."'@'".$this->escape($dolibarr_main_db_host)."' IDENTIFIED BY '".$this->escape($dolibarr_main_db_pass)."'";
|
||||||
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log
|
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user