2
0
forked from Wavyzz/dolibarr

Fix: use dol_hash instead md5 php function

This commit is contained in:
Regis Houssin
2011-09-06 06:53:52 +00:00
parent e13c8a3fde
commit ac4bcfb583
13 changed files with 27 additions and 24 deletions

View File

@@ -467,9 +467,10 @@ function getRandomPassword($generic=false)
* Returns a hash of a string
* @param chain String to hash
* @param type Type of hash (0:md5, 1:sha1, 2:sha1+md5)
* @param salt Salt
* @return hash hash of string
*/
function dol_hash($chain,$type=0)
function dol_hash($chain,$type=0,$salt='')
{
if ($type == 1) return sha1($chain);
else if ($type == 2) return sha1(md5($chain));