allow to return passwords hashes as array

This commit is contained in:
Ralf Becker 2011-04-01 14:00:25 +00:00
parent bab48aee0a
commit 5ea2945538

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)