From 5ea29455381a647ab5b95bc11e604bdfdb357585 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 1 Apr 2011 14:00:25 +0000 Subject: [PATCH] allow to return passwords hashes as array --- setup/inc/hook_config.inc.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup/inc/hook_config.inc.php b/setup/inc/hook_config.inc.php index ec1670e6fb..36707ff35a 100644 --- a/setup/inc/hook_config.inc.php +++ b/setup/inc/hook_config.inc.php @@ -145,7 +145,7 @@ function encryptmode($config) return $out; } -function passwdhashes($config) +function passwdhashes($config,$return_hashes=false) { $hashes = array( 'des' => 'des', @@ -169,6 +169,8 @@ function passwdhashes($config) $hashes['ext_crypt'] = 'ext_crypt'; } + if ($return_hashes) return $hashes; + foreach($hashes as $key => $value) { if($config['ldap_encryption_type'] == $value) @@ -186,7 +188,7 @@ function passwdhashes($config) return $out; } -function sql_passwdhashes($config) +function sql_passwdhashes($config,$return_hashes=false) { $hashes = array( 'md5' => 'md5' @@ -217,6 +219,8 @@ function sql_passwdhashes($config) 'plain' => 'plain', ); + if ($return_hashes) return $hashes; + foreach($hashes as $key => $value) { if($config['sql_encryption_type'] == $value)