Add option to salt hash passwords

This commit is contained in:
Laurent Destailleur
2013-11-04 10:45:43 +01:00
parent d8216a09e1
commit e5fd19ffc0

View File

@@ -77,9 +77,11 @@ function dol_decode($chain)
*/
function dol_hash($chain,$type=0)
{
global $conf;
if ($type == 1) return sha1($chain);
else if ($type == 2) return sha1(md5($chain));
else return md5($chain);
else return md5((empty($conf->global->MAIN_SECURITY_SALT)?'':$conf->global->MAIN_SECURITY_SALT).$chain);
}