forked from Wavyzz/dolibarr
Add test if flush fails
This commit is contained in:
@@ -698,13 +698,13 @@ class DoliDb
|
|||||||
function encrypt($fieldorvalue, $withQuotes=0)
|
function encrypt($fieldorvalue, $withQuotes=0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
// Type of encryption (2: AES (recommended), 1: DES , 0: no encryption)
|
// Type of encryption (2: AES (recommended), 1: DES , 0: no encryption)
|
||||||
$cryptType = ($conf->db->dolibarr_main_db_encryption?$conf->db->dolibarr_main_db_encryption:0);
|
$cryptType = ($conf->db->dolibarr_main_db_encryption?$conf->db->dolibarr_main_db_encryption:0);
|
||||||
|
|
||||||
//Encryption key
|
//Encryption key
|
||||||
$cryptKey = (!empty($conf->db->dolibarr_main_db_cryptkey)?$conf->db->dolibarr_main_db_cryptkey:'');
|
$cryptKey = (!empty($conf->db->dolibarr_main_db_cryptkey)?$conf->db->dolibarr_main_db_cryptkey:'');
|
||||||
|
|
||||||
$return = ($withQuotes?"'":"").addslashes($fieldorvalue).($withQuotes?"'":"");
|
$return = ($withQuotes?"'":"").addslashes($fieldorvalue).($withQuotes?"'":"");
|
||||||
|
|
||||||
if ($cryptType && !empty($cryptKey))
|
if ($cryptType && !empty($cryptKey))
|
||||||
@@ -730,13 +730,13 @@ class DoliDb
|
|||||||
function decrypt($value)
|
function decrypt($value)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
// Type of encryption (2: AES (recommended), 1: DES , 0: no encryption)
|
// Type of encryption (2: AES (recommended), 1: DES , 0: no encryption)
|
||||||
$cryptType = ($conf->db->dolibarr_main_db_encryption?$conf->db->dolibarr_main_db_encryption:0);
|
$cryptType = ($conf->db->dolibarr_main_db_encryption?$conf->db->dolibarr_main_db_encryption:0);
|
||||||
|
|
||||||
//Encryption key
|
//Encryption key
|
||||||
$cryptKey = (!empty($conf->db->dolibarr_main_db_cryptkey)?$conf->db->dolibarr_main_db_cryptkey:'');
|
$cryptKey = (!empty($conf->db->dolibarr_main_db_cryptkey)?$conf->db->dolibarr_main_db_cryptkey:'');
|
||||||
|
|
||||||
$return = $value;
|
$return = $value;
|
||||||
|
|
||||||
if ($cryptType && !empty($cryptKey))
|
if ($cryptType && !empty($cryptKey))
|
||||||
@@ -1024,6 +1024,10 @@ class DoliDb
|
|||||||
|
|
||||||
dol_syslog("mysql.lib::DDLCreateUser sql=".$sql,LOG_DEBUG);
|
dol_syslog("mysql.lib::DDLCreateUser sql=".$sql,LOG_DEBUG);
|
||||||
$resql=$this->query($sql);
|
$resql=$this->query($sql);
|
||||||
|
if (! $resql)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1018,6 +1018,7 @@ class DoliDb
|
|||||||
$resql=$this->query($sql);
|
$resql=$this->query($sql);
|
||||||
if (! $resql)
|
if (! $resql)
|
||||||
{
|
{
|
||||||
|
dol_syslog("mysqli.lib::DDLCreateUser sql=".$sql, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1030,6 +1031,7 @@ class DoliDb
|
|||||||
$resql=$this->query($sql);
|
$resql=$this->query($sql);
|
||||||
if (! $resql)
|
if (! $resql)
|
||||||
{
|
{
|
||||||
|
dol_syslog("mysqli.lib::DDLCreateUser sql=".$sql, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1039,6 +1041,7 @@ class DoliDb
|
|||||||
$resql=$this->query($sql);
|
$resql=$this->query($sql);
|
||||||
if (! $resql)
|
if (! $resql)
|
||||||
{
|
{
|
||||||
|
dol_syslog("mysqli.lib::DDLCreateUser sql=".$sql, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user