forked from Wavyzz/dolibarr
Fix: Encryption of password in file
This commit is contained in:
@@ -53,11 +53,13 @@ function makesalt($type=CRYPT_SALT_LENGTH)
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Encode\decode database password in config file
|
||||
\param level Encode level : 0 no enconding, 1 encoding
|
||||
*/
|
||||
* \brief Encode\decode database password in config file
|
||||
* \param level Encode level : 0 no enconding, 1 encoding
|
||||
* \return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function encodedecode_dbpassconf($level=0)
|
||||
{
|
||||
dolibarr_syslog("security.lib::encodedecode_dbpassconf level=".$level, LOG_DEBUG);
|
||||
$config = '';
|
||||
|
||||
if ($fp = fopen(DOL_DOCUMENT_ROOT.'/conf/conf.php','r'))
|
||||
@@ -95,19 +97,21 @@ function encodedecode_dbpassconf($level=0)
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("security.lib::encodedecode_dbpassconf Failed to open conf.php file for writing", LOG_WARNING);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("security.lib::encodedecode_dbpassconf Failed to read conf.php", LOG_ERR);
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Encode une chaine de caract<63>re
|
||||
\param chain chaine de caract<63>res a encoder
|
||||
\return string_coded chaine de caract<63>res encod<6F>e
|
||||
* \brief Encode une chaine de caract<63>re
|
||||
* \param chaine chaine de caract<63>res a encoder
|
||||
* \return string_coded chaine de caract<63>res encod<6F>e
|
||||
*/
|
||||
function dol_encode($chain)
|
||||
{
|
||||
@@ -121,9 +125,9 @@ function dol_encode($chain)
|
||||
}
|
||||
|
||||
/**
|
||||
\brief Decode une chaine de caract<63>re
|
||||
\param chain chaine de caract<63>res a decoder
|
||||
\return string_coded chaine de caract<63>res decod<6F>e
|
||||
* \brief Decode une chaine de caract<63>re
|
||||
* \param chain chaine de caract<63>res a decoder
|
||||
* \return string_coded chaine de caract<63>res decod<6F>e
|
||||
*/
|
||||
function dol_decode($chain)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user