Add option to salt hash passwords
This commit is contained in:
parent
d8216a09e1
commit
e5fd19ffc0
@ -77,9 +77,11 @@ function dol_decode($chain)
|
|||||||
*/
|
*/
|
||||||
function dol_hash($chain,$type=0)
|
function dol_hash($chain,$type=0)
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
if ($type == 1) return sha1($chain);
|
if ($type == 1) return sha1($chain);
|
||||||
else if ($type == 2) return sha1(md5($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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user