allow to return passwords hashes as array

This commit is contained in:
Ralf Becker 2011-04-01 14:01:01 +00:00
parent 48bf27645e
commit 9d893746a3

View File

@ -145,7 +145,7 @@ function encryptmode($config)
return $out; return $out;
} }
function passwdhashes($config) function passwdhashes($config,$return_hashes=false)
{ {
$hashes = array( $hashes = array(
'des' => 'des', 'des' => 'des',
@ -169,6 +169,8 @@ function passwdhashes($config)
$hashes['ext_crypt'] = 'ext_crypt'; $hashes['ext_crypt'] = 'ext_crypt';
} }
if ($return_hashes) return $hashes;
foreach($hashes as $key => $value) foreach($hashes as $key => $value)
{ {
if($config['ldap_encryption_type'] == $value) if($config['ldap_encryption_type'] == $value)
@ -186,7 +188,7 @@ function passwdhashes($config)
return $out; return $out;
} }
function sql_passwdhashes($config) function sql_passwdhashes($config,$return_hashes=false)
{ {
$hashes = array( $hashes = array(
'md5' => 'md5' 'md5' => 'md5'
@ -217,6 +219,8 @@ function sql_passwdhashes($config)
'plain' => 'plain', 'plain' => 'plain',
); );
if ($return_hashes) return $hashes;
foreach($hashes as $key => $value) foreach($hashes as $key => $value)
{ {
if($config['sql_encryption_type'] == $value) if($config['sql_encryption_type'] == $value)